From 85606df51888a0d6f67294127d6c3e6e4f498955 Mon Sep 17 00:00:00 2001 From: Rodolfo Berrios <20590102+rodber@users.noreply.github.com> Date: Mon, 4 Oct 2021 09:23:47 -0300 Subject: [PATCH] remove app/vendor --- app/vendor/autoload.php | 7 - app/vendor/composer/ClassLoader.php | 481 -- app/vendor/composer/InstalledVersions.php | 337 -- app/vendor/composer/LICENSE | 21 - app/vendor/composer/autoload_classmap.php | 36 - app/vendor/composer/autoload_namespaces.php | 11 - app/vendor/composer/autoload_psr4.php | 11 - app/vendor/composer/autoload_real.php | 55 - app/vendor/composer/autoload_static.php | 88 - app/vendor/composer/installed.json | 326 -- app/vendor/composer/installed.php | 68 - app/vendor/jbroadway/urlify/.gitignore | 4 - app/vendor/jbroadway/urlify/.travis.yml | 16 - app/vendor/jbroadway/urlify/INSTALL | 13 - app/vendor/jbroadway/urlify/LICENSE | 27 - app/vendor/jbroadway/urlify/README.md | 90 - app/vendor/jbroadway/urlify/URLify.php | 300 - app/vendor/jbroadway/urlify/composer.json | 29 - app/vendor/jbroadway/urlify/phpunit.xml | 8 - .../jbroadway/urlify/scripts/downcode.php | 20 - .../jbroadway/urlify/scripts/filter.php | 20 - .../urlify/scripts/transliterate.php | 20 - .../jbroadway/urlify/tests/URLifyTest.php | 60 - .../jbroadway/urlify/tests/bootstrap.php | 9 - app/vendor/mlocati/ip-lib/LICENSE.txt | 20 - app/vendor/mlocati/ip-lib/README.md | 635 --- app/vendor/mlocati/ip-lib/composer.json | 60 - app/vendor/mlocati/ip-lib/ip-lib.php | 13 - .../ip-lib/src/Address/AddressInterface.php | 156 - .../ip-lib/src/Address/AssignedRange.php | 140 - .../mlocati/ip-lib/src/Address/IPv4.php | 509 -- .../mlocati/ip-lib/src/Address/IPv6.php | 595 -- .../mlocati/ip-lib/src/Address/Type.php | 44 - app/vendor/mlocati/ip-lib/src/Factory.php | 298 - .../mlocati/ip-lib/src/ParseStringFlag.php | 67 - .../ip-lib/src/Range/AbstractRange.php | 125 - .../mlocati/ip-lib/src/Range/Pattern.php | 322 -- .../ip-lib/src/Range/RangeInterface.php | 160 - .../mlocati/ip-lib/src/Range/Single.php | 261 - .../mlocati/ip-lib/src/Range/Subnet.php | 354 -- app/vendor/mlocati/ip-lib/src/Range/Type.php | 152 - .../mlocati/ip-lib/src/Service/BinaryMath.php | 120 - .../Service/RangesFromBoundaryCalculator.php | 168 - .../src/Service/UnsignedIntegerMath.php | 171 - .../mobiledetect/mobiledetectlib/LICENSE.txt | 48 - .../mobiledetectlib/Mobile_Detect.json | 1 - .../mobiledetectlib/Mobile_Detect.php | 1683 ------ .../mobiledetect/mobiledetectlib/README.md | 344 -- .../mobiledetectlib/composer.json | 31 - .../mobiledetectlib/docker-compose.yml | 16 - .../mobiledetectlib/docs/CONTRIBUTING.md | 48 - .../mobiledetectlib/docs/HISTORY.md | 11 - .../mobiledetectlib/docs/ISSUE_TEMPLATE.md | 15 - .../mobiledetectlib/docs/KNOWN_LIMITATIONS.md | 14 - .../mobiledetectlib/export/exportToJSON.php | 67 - .../namespaced/Detection/MobileDetect.php | 22 - .../mobiledetect/mobiledetectlib/phpcs.xml | 20 - app/vendor/phpmailer/class.phpmailer.php | 4039 -------------- app/vendor/phpmailer/class.smtp.php | 1251 ----- app/vendor/phpmailer/phpmailer/COMMITMENT | 46 - app/vendor/phpmailer/phpmailer/LICENSE | 502 -- app/vendor/phpmailer/phpmailer/README.md | 222 - app/vendor/phpmailer/phpmailer/SECURITY.md | 37 - app/vendor/phpmailer/phpmailer/VERSION | 1 - app/vendor/phpmailer/phpmailer/composer.json | 65 - .../phpmailer/phpmailer/get_oauth_token.php | 146 - .../phpmailer/language/phpmailer.lang-af.php | 26 - .../phpmailer/language/phpmailer.lang-ar.php | 27 - .../phpmailer/language/phpmailer.lang-az.php | 27 - .../phpmailer/language/phpmailer.lang-ba.php | 27 - .../phpmailer/language/phpmailer.lang-be.php | 27 - .../phpmailer/language/phpmailer.lang-bg.php | 27 - .../phpmailer/language/phpmailer.lang-ca.php | 27 - .../phpmailer/language/phpmailer.lang-ch.php | 27 - .../phpmailer/language/phpmailer.lang-cs.php | 28 - .../phpmailer/language/phpmailer.lang-da.php | 29 - .../phpmailer/language/phpmailer.lang-de.php | 28 - .../phpmailer/language/phpmailer.lang-el.php | 26 - .../phpmailer/language/phpmailer.lang-eo.php | 26 - .../phpmailer/language/phpmailer.lang-es.php | 27 - .../phpmailer/language/phpmailer.lang-et.php | 28 - .../phpmailer/language/phpmailer.lang-fa.php | 28 - .../phpmailer/language/phpmailer.lang-fi.php | 28 - .../phpmailer/language/phpmailer.lang-fo.php | 27 - .../phpmailer/language/phpmailer.lang-fr.php | 32 - .../phpmailer/language/phpmailer.lang-gl.php | 27 - .../phpmailer/language/phpmailer.lang-he.php | 27 - .../phpmailer/language/phpmailer.lang-hi.php | 27 - .../phpmailer/language/phpmailer.lang-hr.php | 27 - .../phpmailer/language/phpmailer.lang-hu.php | 27 - .../phpmailer/language/phpmailer.lang-hy.php | 27 - .../phpmailer/language/phpmailer.lang-id.php | 31 - .../phpmailer/language/phpmailer.lang-it.php | 28 - .../phpmailer/language/phpmailer.lang-ja.php | 28 - .../phpmailer/language/phpmailer.lang-ka.php | 27 - .../phpmailer/language/phpmailer.lang-ko.php | 27 - .../phpmailer/language/phpmailer.lang-lt.php | 27 - .../phpmailer/language/phpmailer.lang-lv.php | 27 - .../phpmailer/language/phpmailer.lang-mg.php | 27 - .../phpmailer/language/phpmailer.lang-ms.php | 27 - .../phpmailer/language/phpmailer.lang-nb.php | 26 - .../phpmailer/language/phpmailer.lang-nl.php | 29 - .../phpmailer/language/phpmailer.lang-pl.php | 27 - .../phpmailer/language/phpmailer.lang-pt.php | 27 - .../language/phpmailer.lang-pt_br.php | 30 - .../phpmailer/language/phpmailer.lang-ro.php | 27 - .../phpmailer/language/phpmailer.lang-ru.php | 28 - .../phpmailer/language/phpmailer.lang-sk.php | 30 - .../phpmailer/language/phpmailer.lang-sl.php | 31 - .../phpmailer/language/phpmailer.lang-sr.php | 28 - .../language/phpmailer.lang-sr_latn.php | 28 - .../phpmailer/language/phpmailer.lang-sv.php | 27 - .../phpmailer/language/phpmailer.lang-tl.php | 28 - .../phpmailer/language/phpmailer.lang-tr.php | 31 - .../phpmailer/language/phpmailer.lang-uk.php | 28 - .../phpmailer/language/phpmailer.lang-vi.php | 27 - .../phpmailer/language/phpmailer.lang-zh.php | 29 - .../language/phpmailer.lang-zh_cn.php | 29 - .../phpmailer/phpmailer/phpunit.xml.dist | 35 - .../phpmailer/phpmailer/src/Exception.php | 40 - app/vendor/phpmailer/phpmailer/src/OAuth.php | 139 - .../phpmailer/phpmailer/src/PHPMailer.php | 4970 ----------------- app/vendor/phpmailer/phpmailer/src/POP3.php | 448 -- app/vendor/phpmailer/phpmailer/src/SMTP.php | 1456 ----- app/vendor/recaptchalib.php | 279 - app/vendor/serbanghita/Mobile_Detect.php | 1459 ----- app/vendor/tijsverkoyen/akismet/Akismet.php | 526 -- app/vendor/tijsverkoyen/akismet/Exception.php | 77 - app/vendor/tijsverkoyen/akismet/LICENSE.md | 22 - app/vendor/tijsverkoyen/akismet/composer.json | 21 - 130 files changed, 25971 deletions(-) delete mode 100644 app/vendor/autoload.php delete mode 100644 app/vendor/composer/ClassLoader.php delete mode 100644 app/vendor/composer/InstalledVersions.php delete mode 100644 app/vendor/composer/LICENSE delete mode 100644 app/vendor/composer/autoload_classmap.php delete mode 100644 app/vendor/composer/autoload_namespaces.php delete mode 100644 app/vendor/composer/autoload_psr4.php delete mode 100644 app/vendor/composer/autoload_real.php delete mode 100644 app/vendor/composer/autoload_static.php delete mode 100644 app/vendor/composer/installed.json delete mode 100644 app/vendor/composer/installed.php delete mode 100644 app/vendor/jbroadway/urlify/.gitignore delete mode 100644 app/vendor/jbroadway/urlify/.travis.yml delete mode 100644 app/vendor/jbroadway/urlify/INSTALL delete mode 100644 app/vendor/jbroadway/urlify/LICENSE delete mode 100644 app/vendor/jbroadway/urlify/README.md delete mode 100644 app/vendor/jbroadway/urlify/URLify.php delete mode 100644 app/vendor/jbroadway/urlify/composer.json delete mode 100644 app/vendor/jbroadway/urlify/phpunit.xml delete mode 100644 app/vendor/jbroadway/urlify/scripts/downcode.php delete mode 100644 app/vendor/jbroadway/urlify/scripts/filter.php delete mode 100644 app/vendor/jbroadway/urlify/scripts/transliterate.php delete mode 100644 app/vendor/jbroadway/urlify/tests/URLifyTest.php delete mode 100644 app/vendor/jbroadway/urlify/tests/bootstrap.php delete mode 100644 app/vendor/mlocati/ip-lib/LICENSE.txt delete mode 100644 app/vendor/mlocati/ip-lib/README.md delete mode 100644 app/vendor/mlocati/ip-lib/composer.json delete mode 100644 app/vendor/mlocati/ip-lib/ip-lib.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Address/AddressInterface.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Address/AssignedRange.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Address/IPv4.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Address/IPv6.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Address/Type.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Factory.php delete mode 100644 app/vendor/mlocati/ip-lib/src/ParseStringFlag.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Range/AbstractRange.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Range/Pattern.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Range/RangeInterface.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Range/Single.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Range/Subnet.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Range/Type.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Service/BinaryMath.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Service/RangesFromBoundaryCalculator.php delete mode 100644 app/vendor/mlocati/ip-lib/src/Service/UnsignedIntegerMath.php delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/LICENSE.txt delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.json delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/README.md delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/composer.json delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/docker-compose.yml delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/docs/CONTRIBUTING.md delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/docs/HISTORY.md delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/docs/ISSUE_TEMPLATE.md delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/docs/KNOWN_LIMITATIONS.md delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php delete mode 100644 app/vendor/mobiledetect/mobiledetectlib/phpcs.xml delete mode 100644 app/vendor/phpmailer/class.phpmailer.php delete mode 100644 app/vendor/phpmailer/class.smtp.php delete mode 100644 app/vendor/phpmailer/phpmailer/COMMITMENT delete mode 100644 app/vendor/phpmailer/phpmailer/LICENSE delete mode 100644 app/vendor/phpmailer/phpmailer/README.md delete mode 100644 app/vendor/phpmailer/phpmailer/SECURITY.md delete mode 100644 app/vendor/phpmailer/phpmailer/VERSION delete mode 100644 app/vendor/phpmailer/phpmailer/composer.json delete mode 100644 app/vendor/phpmailer/phpmailer/get_oauth_token.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ar.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ba.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-da.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-el.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-eo.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-es.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fo.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-gl.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hy.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-nl.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-uk.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php delete mode 100644 app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php delete mode 100644 app/vendor/phpmailer/phpmailer/phpunit.xml.dist delete mode 100644 app/vendor/phpmailer/phpmailer/src/Exception.php delete mode 100644 app/vendor/phpmailer/phpmailer/src/OAuth.php delete mode 100644 app/vendor/phpmailer/phpmailer/src/PHPMailer.php delete mode 100644 app/vendor/phpmailer/phpmailer/src/POP3.php delete mode 100644 app/vendor/phpmailer/phpmailer/src/SMTP.php delete mode 100644 app/vendor/recaptchalib.php delete mode 100644 app/vendor/serbanghita/Mobile_Detect.php delete mode 100755 app/vendor/tijsverkoyen/akismet/Akismet.php delete mode 100644 app/vendor/tijsverkoyen/akismet/Exception.php delete mode 100644 app/vendor/tijsverkoyen/akismet/LICENSE.md delete mode 100644 app/vendor/tijsverkoyen/akismet/composer.json diff --git a/app/vendor/autoload.php b/app/vendor/autoload.php deleted file mode 100644 index b119445..0000000 --- a/app/vendor/autoload.php +++ /dev/null @@ -1,7 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer\Autoload; - -/** - * ClassLoader implements a PSR-0, PSR-4 and classmap class loader. - * - * $loader = new \Composer\Autoload\ClassLoader(); - * - * // register classes with namespaces - * $loader->add('Symfony\Component', __DIR__.'/component'); - * $loader->add('Symfony', __DIR__.'/framework'); - * - * // activate the autoloader - * $loader->register(); - * - * // to enable searching the include path (eg. for PEAR packages) - * $loader->setUseIncludePath(true); - * - * In this example, if you try to use a class in the Symfony\Component - * namespace or one of its children (Symfony\Component\Console for instance), - * the autoloader will first look for the class under the component/ - * directory, and it will then fallback to the framework/ directory if not - * found before giving up. - * - * This class is loosely based on the Symfony UniversalClassLoader. - * - * @author Fabien Potencier - * @author Jordi Boggiano - * @see https://www.php-fig.org/psr/psr-0/ - * @see https://www.php-fig.org/psr/psr-4/ - */ -class ClassLoader -{ - private $vendorDir; - - // PSR-4 - private $prefixLengthsPsr4 = array(); - private $prefixDirsPsr4 = array(); - private $fallbackDirsPsr4 = array(); - - // PSR-0 - private $prefixesPsr0 = array(); - private $fallbackDirsPsr0 = array(); - - private $useIncludePath = false; - private $classMap = array(); - private $classMapAuthoritative = false; - private $missingClasses = array(); - private $apcuPrefix; - - private static $registeredLoaders = array(); - - public function __construct($vendorDir = null) - { - $this->vendorDir = $vendorDir; - } - - public function getPrefixes() - { - if (!empty($this->prefixesPsr0)) { - return call_user_func_array('array_merge', array_values($this->prefixesPsr0)); - } - - return array(); - } - - public function getPrefixesPsr4() - { - return $this->prefixDirsPsr4; - } - - public function getFallbackDirs() - { - return $this->fallbackDirsPsr0; - } - - public function getFallbackDirsPsr4() - { - return $this->fallbackDirsPsr4; - } - - public function getClassMap() - { - return $this->classMap; - } - - /** - * @param array $classMap Class to filename map - */ - public function addClassMap(array $classMap) - { - if ($this->classMap) { - $this->classMap = array_merge($this->classMap, $classMap); - } else { - $this->classMap = $classMap; - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, either - * appending or prepending to the ones previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 root directories - * @param bool $prepend Whether to prepend the directories - */ - public function add($prefix, $paths, $prepend = false) - { - if (!$prefix) { - if ($prepend) { - $this->fallbackDirsPsr0 = array_merge( - (array) $paths, - $this->fallbackDirsPsr0 - ); - } else { - $this->fallbackDirsPsr0 = array_merge( - $this->fallbackDirsPsr0, - (array) $paths - ); - } - - return; - } - - $first = $prefix[0]; - if (!isset($this->prefixesPsr0[$first][$prefix])) { - $this->prefixesPsr0[$first][$prefix] = (array) $paths; - - return; - } - if ($prepend) { - $this->prefixesPsr0[$first][$prefix] = array_merge( - (array) $paths, - $this->prefixesPsr0[$first][$prefix] - ); - } else { - $this->prefixesPsr0[$first][$prefix] = array_merge( - $this->prefixesPsr0[$first][$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, either - * appending or prepending to the ones previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * @param bool $prepend Whether to prepend the directories - * - * @throws \InvalidArgumentException - */ - public function addPsr4($prefix, $paths, $prepend = false) - { - if (!$prefix) { - // Register directories for the root namespace. - if ($prepend) { - $this->fallbackDirsPsr4 = array_merge( - (array) $paths, - $this->fallbackDirsPsr4 - ); - } else { - $this->fallbackDirsPsr4 = array_merge( - $this->fallbackDirsPsr4, - (array) $paths - ); - } - } elseif (!isset($this->prefixDirsPsr4[$prefix])) { - // Register directories for a new namespace. - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } elseif ($prepend) { - // Prepend directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - (array) $paths, - $this->prefixDirsPsr4[$prefix] - ); - } else { - // Append directories for an already registered namespace. - $this->prefixDirsPsr4[$prefix] = array_merge( - $this->prefixDirsPsr4[$prefix], - (array) $paths - ); - } - } - - /** - * Registers a set of PSR-0 directories for a given prefix, - * replacing any others previously set for this prefix. - * - * @param string $prefix The prefix - * @param array|string $paths The PSR-0 base directories - */ - public function set($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr0 = (array) $paths; - } else { - $this->prefixesPsr0[$prefix[0]][$prefix] = (array) $paths; - } - } - - /** - * Registers a set of PSR-4 directories for a given namespace, - * replacing any others previously set for this namespace. - * - * @param string $prefix The prefix/namespace, with trailing '\\' - * @param array|string $paths The PSR-4 base directories - * - * @throws \InvalidArgumentException - */ - public function setPsr4($prefix, $paths) - { - if (!$prefix) { - $this->fallbackDirsPsr4 = (array) $paths; - } else { - $length = strlen($prefix); - if ('\\' !== $prefix[$length - 1]) { - throw new \InvalidArgumentException("A non-empty PSR-4 prefix must end with a namespace separator."); - } - $this->prefixLengthsPsr4[$prefix[0]][$prefix] = $length; - $this->prefixDirsPsr4[$prefix] = (array) $paths; - } - } - - /** - * Turns on searching the include path for class files. - * - * @param bool $useIncludePath - */ - public function setUseIncludePath($useIncludePath) - { - $this->useIncludePath = $useIncludePath; - } - - /** - * Can be used to check if the autoloader uses the include path to check - * for classes. - * - * @return bool - */ - public function getUseIncludePath() - { - return $this->useIncludePath; - } - - /** - * Turns off searching the prefix and fallback directories for classes - * that have not been registered with the class map. - * - * @param bool $classMapAuthoritative - */ - public function setClassMapAuthoritative($classMapAuthoritative) - { - $this->classMapAuthoritative = $classMapAuthoritative; - } - - /** - * Should class lookup fail if not found in the current class map? - * - * @return bool - */ - public function isClassMapAuthoritative() - { - return $this->classMapAuthoritative; - } - - /** - * APCu prefix to use to cache found/not-found classes, if the extension is enabled. - * - * @param string|null $apcuPrefix - */ - public function setApcuPrefix($apcuPrefix) - { - $this->apcuPrefix = function_exists('apcu_fetch') && filter_var(ini_get('apc.enabled'), FILTER_VALIDATE_BOOLEAN) ? $apcuPrefix : null; - } - - /** - * The APCu prefix in use, or null if APCu caching is not enabled. - * - * @return string|null - */ - public function getApcuPrefix() - { - return $this->apcuPrefix; - } - - /** - * Registers this instance as an autoloader. - * - * @param bool $prepend Whether to prepend the autoloader or not - */ - public function register($prepend = false) - { - spl_autoload_register(array($this, 'loadClass'), true, $prepend); - - if (null === $this->vendorDir) { - return; - } - - if ($prepend) { - self::$registeredLoaders = array($this->vendorDir => $this) + self::$registeredLoaders; - } else { - unset(self::$registeredLoaders[$this->vendorDir]); - self::$registeredLoaders[$this->vendorDir] = $this; - } - } - - /** - * Unregisters this instance as an autoloader. - */ - public function unregister() - { - spl_autoload_unregister(array($this, 'loadClass')); - - if (null !== $this->vendorDir) { - unset(self::$registeredLoaders[$this->vendorDir]); - } - } - - /** - * Loads the given class or interface. - * - * @param string $class The name of the class - * @return true|null True if loaded, null otherwise - */ - public function loadClass($class) - { - if ($file = $this->findFile($class)) { - includeFile($file); - - return true; - } - - return null; - } - - /** - * Finds the path to the file where the class is defined. - * - * @param string $class The name of the class - * - * @return string|false The path if found, false otherwise - */ - public function findFile($class) - { - // class map lookup - if (isset($this->classMap[$class])) { - return $this->classMap[$class]; - } - if ($this->classMapAuthoritative || isset($this->missingClasses[$class])) { - return false; - } - if (null !== $this->apcuPrefix) { - $file = apcu_fetch($this->apcuPrefix.$class, $hit); - if ($hit) { - return $file; - } - } - - $file = $this->findFileWithExtension($class, '.php'); - - // Search for Hack files if we are running on HHVM - if (false === $file && defined('HHVM_VERSION')) { - $file = $this->findFileWithExtension($class, '.hh'); - } - - if (null !== $this->apcuPrefix) { - apcu_add($this->apcuPrefix.$class, $file); - } - - if (false === $file) { - // Remember that this class does not exist. - $this->missingClasses[$class] = true; - } - - return $file; - } - - /** - * Returns the currently registered loaders indexed by their corresponding vendor directories. - * - * @return self[] - */ - public static function getRegisteredLoaders() - { - return self::$registeredLoaders; - } - - private function findFileWithExtension($class, $ext) - { - // PSR-4 lookup - $logicalPathPsr4 = strtr($class, '\\', DIRECTORY_SEPARATOR) . $ext; - - $first = $class[0]; - if (isset($this->prefixLengthsPsr4[$first])) { - $subPath = $class; - while (false !== $lastPos = strrpos($subPath, '\\')) { - $subPath = substr($subPath, 0, $lastPos); - $search = $subPath . '\\'; - if (isset($this->prefixDirsPsr4[$search])) { - $pathEnd = DIRECTORY_SEPARATOR . substr($logicalPathPsr4, $lastPos + 1); - foreach ($this->prefixDirsPsr4[$search] as $dir) { - if (file_exists($file = $dir . $pathEnd)) { - return $file; - } - } - } - } - } - - // PSR-4 fallback dirs - foreach ($this->fallbackDirsPsr4 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr4)) { - return $file; - } - } - - // PSR-0 lookup - if (false !== $pos = strrpos($class, '\\')) { - // namespaced class name - $logicalPathPsr0 = substr($logicalPathPsr4, 0, $pos + 1) - . strtr(substr($logicalPathPsr4, $pos + 1), '_', DIRECTORY_SEPARATOR); - } else { - // PEAR-like class name - $logicalPathPsr0 = strtr($class, '_', DIRECTORY_SEPARATOR) . $ext; - } - - if (isset($this->prefixesPsr0[$first])) { - foreach ($this->prefixesPsr0[$first] as $prefix => $dirs) { - if (0 === strpos($class, $prefix)) { - foreach ($dirs as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - } - } - } - - // PSR-0 fallback dirs - foreach ($this->fallbackDirsPsr0 as $dir) { - if (file_exists($file = $dir . DIRECTORY_SEPARATOR . $logicalPathPsr0)) { - return $file; - } - } - - // PSR-0 include paths. - if ($this->useIncludePath && $file = stream_resolve_include_path($logicalPathPsr0)) { - return $file; - } - - return false; - } -} - -/** - * Scope isolated include. - * - * Prevents access to $this/self from included files. - */ -function includeFile($file) -{ - include $file; -} diff --git a/app/vendor/composer/InstalledVersions.php b/app/vendor/composer/InstalledVersions.php deleted file mode 100644 index b3a4e16..0000000 --- a/app/vendor/composer/InstalledVersions.php +++ /dev/null @@ -1,337 +0,0 @@ - - * Jordi Boggiano - * - * For the full copyright and license information, please view the LICENSE - * file that was distributed with this source code. - */ - -namespace Composer; - -use Composer\Autoload\ClassLoader; -use Composer\Semver\VersionParser; - -/** - * This class is copied in every Composer installed project and available to all - * - * See also https://getcomposer.org/doc/07-runtime.md#installed-versions - * - * To require it's presence, you can require `composer-runtime-api ^2.0` - */ -class InstalledVersions -{ - private static $installed; - private static $canGetVendors; - private static $installedByVendor = array(); - - /** - * Returns a list of all package names which are present, either by being installed, replaced or provided - * - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackages() - { - $packages = array(); - foreach (self::getInstalled() as $installed) { - $packages[] = array_keys($installed['versions']); - } - - if (1 === \count($packages)) { - return $packages[0]; - } - - return array_keys(array_flip(\call_user_func_array('array_merge', $packages))); - } - - /** - * Returns a list of all package names with a specific type e.g. 'library' - * - * @param string $type - * @return string[] - * @psalm-return list - */ - public static function getInstalledPackagesByType($type) - { - $packagesByType = array(); - - foreach (self::getInstalled() as $installed) { - foreach ($installed['versions'] as $name => $package) { - if (isset($package['type']) && $package['type'] === $type) { - $packagesByType[] = $name; - } - } - } - - return $packagesByType; - } - - /** - * Checks whether the given package is installed - * - * This also returns true if the package name is provided or replaced by another package - * - * @param string $packageName - * @param bool $includeDevRequirements - * @return bool - */ - public static function isInstalled($packageName, $includeDevRequirements = true) - { - foreach (self::getInstalled() as $installed) { - if (isset($installed['versions'][$packageName])) { - return $includeDevRequirements || empty($installed['versions'][$packageName]['dev_requirement']); - } - } - - return false; - } - - /** - * Checks whether the given package satisfies a version constraint - * - * e.g. If you want to know whether version 2.3+ of package foo/bar is installed, you would call: - * - * Composer\InstalledVersions::satisfies(new VersionParser, 'foo/bar', '^2.3') - * - * @param VersionParser $parser Install composer/semver to have access to this class and functionality - * @param string $packageName - * @param string|null $constraint A version constraint to check for, if you pass one you have to make sure composer/semver is required by your package - * @return bool - */ - public static function satisfies(VersionParser $parser, $packageName, $constraint) - { - $constraint = $parser->parseConstraints($constraint); - $provided = $parser->parseConstraints(self::getVersionRanges($packageName)); - - return $provided->matches($constraint); - } - - /** - * Returns a version constraint representing all the range(s) which are installed for a given package - * - * It is easier to use this via isInstalled() with the $constraint argument if you need to check - * whether a given version of a package is installed, and not just whether it exists - * - * @param string $packageName - * @return string Version constraint usable with composer/semver - */ - public static function getVersionRanges($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - $ranges = array(); - if (isset($installed['versions'][$packageName]['pretty_version'])) { - $ranges[] = $installed['versions'][$packageName]['pretty_version']; - } - if (array_key_exists('aliases', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['aliases']); - } - if (array_key_exists('replaced', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['replaced']); - } - if (array_key_exists('provided', $installed['versions'][$packageName])) { - $ranges = array_merge($ranges, $installed['versions'][$packageName]['provided']); - } - - return implode(' || ', $ranges); - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['version'])) { - return null; - } - - return $installed['versions'][$packageName]['version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as version, use satisfies or getVersionRanges if you need to know if a given version is present - */ - public static function getPrettyVersion($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['pretty_version'])) { - return null; - } - - return $installed['versions'][$packageName]['pretty_version']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as reference - */ - public static function getReference($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - if (!isset($installed['versions'][$packageName]['reference'])) { - return null; - } - - return $installed['versions'][$packageName]['reference']; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @param string $packageName - * @return string|null If the package is being replaced or provided but is not really installed, null will be returned as install path. Packages of type metapackages also have a null install path. - */ - public static function getInstallPath($packageName) - { - foreach (self::getInstalled() as $installed) { - if (!isset($installed['versions'][$packageName])) { - continue; - } - - return isset($installed['versions'][$packageName]['install_path']) ? $installed['versions'][$packageName]['install_path'] : null; - } - - throw new \OutOfBoundsException('Package "' . $packageName . '" is not installed'); - } - - /** - * @return array - * @psalm-return array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string} - */ - public static function getRootPackage() - { - $installed = self::getInstalled(); - - return $installed[0]['root']; - } - - /** - * Returns the raw installed.php data for custom implementations - * - * @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, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} - */ - public static function getRawData() - { - @trigger_error('getRawData only returns the first dataset loaded, which may not be what you expect. Use getAllRawData() instead which returns all datasets for all autoloaders present in the process.', E_USER_DEPRECATED); - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = include __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - - return self::$installed; - } - - /** - * Returns the raw data of all installed.php which are currently loaded for custom implementations - * - * @return array[] - * @psalm-return list}> - */ - public static function getAllRawData() - { - return self::getInstalled(); - } - - /** - * Lets you reload the static array from another file - * - * This is only useful for complex integrations in which a project needs to use - * this class but then also needs to execute another project's autoloader in process, - * and wants to ensure both projects have access to their version of installed.php. - * - * A typical case would be PHPUnit, where it would need to make sure it reads all - * the data it needs from this class, then call reload() with - * `require $CWD/vendor/composer/installed.php` (or similar) as input to make sure - * the project in which it runs can then also use this class safely, without - * interference between PHPUnit's dependencies and the project's dependencies. - * - * @param array[] $data A vendor/composer/installed.php data set - * @return void - * - * @psalm-param array{root: array{name: string, version: string, reference: string, pretty_version: string, aliases: string[], dev: bool, install_path: string}, versions: array} $data - */ - public static function reload($data) - { - self::$installed = $data; - self::$installedByVendor = array(); - } - - /** - * @return array[] - * @psalm-return list}> - */ - private static function getInstalled() - { - if (null === self::$canGetVendors) { - self::$canGetVendors = method_exists('Composer\Autoload\ClassLoader', 'getRegisteredLoaders'); - } - - $installed = array(); - - if (self::$canGetVendors) { - foreach (ClassLoader::getRegisteredLoaders() as $vendorDir => $loader) { - if (isset(self::$installedByVendor[$vendorDir])) { - $installed[] = self::$installedByVendor[$vendorDir]; - } elseif (is_file($vendorDir.'/composer/installed.php')) { - $installed[] = self::$installedByVendor[$vendorDir] = require $vendorDir.'/composer/installed.php'; - if (null === self::$installed && strtr($vendorDir.'/composer', '\\', '/') === strtr(__DIR__, '\\', '/')) { - self::$installed = $installed[count($installed) - 1]; - } - } - } - } - - if (null === self::$installed) { - // only require the installed.php file if this file is loaded from its dumped location, - // and not from its source location in the composer/composer package, see https://github.com/composer/composer/issues/9937 - if (substr(__DIR__, -8, 1) !== 'C') { - self::$installed = require __DIR__ . '/installed.php'; - } else { - self::$installed = array(); - } - } - $installed[] = self::$installed; - - return $installed; - } -} diff --git a/app/vendor/composer/LICENSE b/app/vendor/composer/LICENSE deleted file mode 100644 index f27399a..0000000 --- a/app/vendor/composer/LICENSE +++ /dev/null @@ -1,21 +0,0 @@ - -Copyright (c) Nils Adermann, Jordi Boggiano - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is furnished -to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - diff --git a/app/vendor/composer/autoload_classmap.php b/app/vendor/composer/autoload_classmap.php deleted file mode 100644 index a33b975..0000000 --- a/app/vendor/composer/autoload_classmap.php +++ /dev/null @@ -1,36 +0,0 @@ - $vendorDir . '/composer/InstalledVersions.php', - 'Detection\\MobileDetect' => $vendorDir . '/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php', - 'IPLib\\Address\\AddressInterface' => $vendorDir . '/mlocati/ip-lib/src/Address/AddressInterface.php', - 'IPLib\\Address\\AssignedRange' => $vendorDir . '/mlocati/ip-lib/src/Address/AssignedRange.php', - 'IPLib\\Address\\IPv4' => $vendorDir . '/mlocati/ip-lib/src/Address/IPv4.php', - 'IPLib\\Address\\IPv6' => $vendorDir . '/mlocati/ip-lib/src/Address/IPv6.php', - 'IPLib\\Address\\Type' => $vendorDir . '/mlocati/ip-lib/src/Address/Type.php', - 'IPLib\\Factory' => $vendorDir . '/mlocati/ip-lib/src/Factory.php', - 'IPLib\\ParseStringFlag' => $vendorDir . '/mlocati/ip-lib/src/ParseStringFlag.php', - 'IPLib\\Range\\AbstractRange' => $vendorDir . '/mlocati/ip-lib/src/Range/AbstractRange.php', - 'IPLib\\Range\\Pattern' => $vendorDir . '/mlocati/ip-lib/src/Range/Pattern.php', - 'IPLib\\Range\\RangeInterface' => $vendorDir . '/mlocati/ip-lib/src/Range/RangeInterface.php', - 'IPLib\\Range\\Single' => $vendorDir . '/mlocati/ip-lib/src/Range/Single.php', - 'IPLib\\Range\\Subnet' => $vendorDir . '/mlocati/ip-lib/src/Range/Subnet.php', - 'IPLib\\Range\\Type' => $vendorDir . '/mlocati/ip-lib/src/Range/Type.php', - 'IPLib\\Service\\BinaryMath' => $vendorDir . '/mlocati/ip-lib/src/Service/BinaryMath.php', - 'IPLib\\Service\\RangesFromBoundaryCalculator' => $vendorDir . '/mlocati/ip-lib/src/Service/RangesFromBoundaryCalculator.php', - 'IPLib\\Service\\UnsignedIntegerMath' => $vendorDir . '/mlocati/ip-lib/src/Service/UnsignedIntegerMath.php', - 'Mobile_Detect' => $vendorDir . '/mobiledetect/mobiledetectlib/Mobile_Detect.php', - 'PHPMailer\\PHPMailer\\Exception' => $vendorDir . '/phpmailer/phpmailer/src/Exception.php', - 'PHPMailer\\PHPMailer\\OAuth' => $vendorDir . '/phpmailer/phpmailer/src/OAuth.php', - 'PHPMailer\\PHPMailer\\PHPMailer' => $vendorDir . '/phpmailer/phpmailer/src/PHPMailer.php', - 'PHPMailer\\PHPMailer\\POP3' => $vendorDir . '/phpmailer/phpmailer/src/POP3.php', - 'PHPMailer\\PHPMailer\\SMTP' => $vendorDir . '/phpmailer/phpmailer/src/SMTP.php', - 'TijsVerkoyen\\Akismet\\Akismet' => $vendorDir . '/tijsverkoyen/akismet/Akismet.php', - 'TijsVerkoyen\\Akismet\\Exception' => $vendorDir . '/tijsverkoyen/akismet/Exception.php', - 'URLify' => $vendorDir . '/jbroadway/urlify/URLify.php', -); diff --git a/app/vendor/composer/autoload_namespaces.php b/app/vendor/composer/autoload_namespaces.php deleted file mode 100644 index fa3193a..0000000 --- a/app/vendor/composer/autoload_namespaces.php +++ /dev/null @@ -1,11 +0,0 @@ - array($vendorDir . '/jbroadway/urlify'), - 'Detection' => array($vendorDir . '/mobiledetect/mobiledetectlib/namespaced'), -); diff --git a/app/vendor/composer/autoload_psr4.php b/app/vendor/composer/autoload_psr4.php deleted file mode 100644 index e18c88e..0000000 --- a/app/vendor/composer/autoload_psr4.php +++ /dev/null @@ -1,11 +0,0 @@ - array($vendorDir . '/phpmailer/phpmailer/src'), - 'IPLib\\' => array($vendorDir . '/mlocati/ip-lib/src'), -); diff --git a/app/vendor/composer/autoload_real.php b/app/vendor/composer/autoload_real.php deleted file mode 100644 index d291e0c..0000000 --- a/app/vendor/composer/autoload_real.php +++ /dev/null @@ -1,55 +0,0 @@ -= 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\ComposerStaticInit5ebab6dc32ca006b1a67a63e20c04846::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); - - return $loader; - } -} diff --git a/app/vendor/composer/autoload_static.php b/app/vendor/composer/autoload_static.php deleted file mode 100644 index afe41bb..0000000 --- a/app/vendor/composer/autoload_static.php +++ /dev/null @@ -1,88 +0,0 @@ - - array ( - 'PHPMailer\\PHPMailer\\' => 20, - ), - 'I' => - array ( - 'IPLib\\' => 6, - ), - ); - - public static $prefixDirsPsr4 = array ( - 'PHPMailer\\PHPMailer\\' => - array ( - 0 => __DIR__ . '/..' . '/phpmailer/phpmailer/src', - ), - 'IPLib\\' => - array ( - 0 => __DIR__ . '/..' . '/mlocati/ip-lib/src', - ), - ); - - public static $prefixesPsr0 = array ( - 'U' => - array ( - 'URLify' => - array ( - 0 => __DIR__ . '/..' . '/jbroadway/urlify', - ), - ), - 'D' => - array ( - 'Detection' => - array ( - 0 => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/namespaced', - ), - ), - ); - - public static $classMap = array ( - 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', - 'Detection\\MobileDetect' => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php', - 'IPLib\\Address\\AddressInterface' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Address/AddressInterface.php', - 'IPLib\\Address\\AssignedRange' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Address/AssignedRange.php', - 'IPLib\\Address\\IPv4' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Address/IPv4.php', - 'IPLib\\Address\\IPv6' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Address/IPv6.php', - 'IPLib\\Address\\Type' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Address/Type.php', - 'IPLib\\Factory' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Factory.php', - 'IPLib\\ParseStringFlag' => __DIR__ . '/..' . '/mlocati/ip-lib/src/ParseStringFlag.php', - 'IPLib\\Range\\AbstractRange' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Range/AbstractRange.php', - 'IPLib\\Range\\Pattern' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Range/Pattern.php', - 'IPLib\\Range\\RangeInterface' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Range/RangeInterface.php', - 'IPLib\\Range\\Single' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Range/Single.php', - 'IPLib\\Range\\Subnet' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Range/Subnet.php', - 'IPLib\\Range\\Type' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Range/Type.php', - 'IPLib\\Service\\BinaryMath' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Service/BinaryMath.php', - 'IPLib\\Service\\RangesFromBoundaryCalculator' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Service/RangesFromBoundaryCalculator.php', - 'IPLib\\Service\\UnsignedIntegerMath' => __DIR__ . '/..' . '/mlocati/ip-lib/src/Service/UnsignedIntegerMath.php', - 'Mobile_Detect' => __DIR__ . '/..' . '/mobiledetect/mobiledetectlib/Mobile_Detect.php', - 'PHPMailer\\PHPMailer\\Exception' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/Exception.php', - 'PHPMailer\\PHPMailer\\OAuth' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/OAuth.php', - 'PHPMailer\\PHPMailer\\PHPMailer' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/PHPMailer.php', - 'PHPMailer\\PHPMailer\\POP3' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/POP3.php', - 'PHPMailer\\PHPMailer\\SMTP' => __DIR__ . '/..' . '/phpmailer/phpmailer/src/SMTP.php', - 'TijsVerkoyen\\Akismet\\Akismet' => __DIR__ . '/..' . '/tijsverkoyen/akismet/Akismet.php', - 'TijsVerkoyen\\Akismet\\Exception' => __DIR__ . '/..' . '/tijsverkoyen/akismet/Exception.php', - 'URLify' => __DIR__ . '/..' . '/jbroadway/urlify/URLify.php', - ); - - public static function getInitializer(ClassLoader $loader) - { - return \Closure::bind(function () use ($loader) { - $loader->prefixLengthsPsr4 = ComposerStaticInit5ebab6dc32ca006b1a67a63e20c04846::$prefixLengthsPsr4; - $loader->prefixDirsPsr4 = ComposerStaticInit5ebab6dc32ca006b1a67a63e20c04846::$prefixDirsPsr4; - $loader->prefixesPsr0 = ComposerStaticInit5ebab6dc32ca006b1a67a63e20c04846::$prefixesPsr0; - $loader->classMap = ComposerStaticInit5ebab6dc32ca006b1a67a63e20c04846::$classMap; - - }, null, ClassLoader::class); - } -} diff --git a/app/vendor/composer/installed.json b/app/vendor/composer/installed.json deleted file mode 100644 index 6eb9de5..0000000 --- a/app/vendor/composer/installed.json +++ /dev/null @@ -1,326 +0,0 @@ -{ - "packages": [ - { - "name": "jbroadway/urlify", - "version": "1.1.3-stable", - "version_normalized": "1.1.3.0", - "source": { - "type": "git", - "url": "https://github.com/jbroadway/urlify.git", - "reference": "37fe4e7680a1c8cd68ac43a27dac7ef4be476300" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/jbroadway/urlify/zipball/37fe4e7680a1c8cd68ac43a27dac7ef4be476300", - "reference": "37fe4e7680a1c8cd68ac43a27dac7ef4be476300", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5" - }, - "time": "2019-06-13T18:30:56+00:00", - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "installation-source": "dist", - "autoload": { - "psr-0": { - "URLify": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause-Clear" - ], - "authors": [ - { - "name": "Johnny Broadway", - "email": "johnny@johnnybroadway.com", - "homepage": "http://www.johnnybroadway.com/" - } - ], - "description": "PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.", - "homepage": "https://github.com/jbroadway/urlify", - "keywords": [ - "encode", - "iconv", - "link", - "slug", - "translit", - "transliterate", - "transliteration", - "url", - "urlify" - ], - "install-path": "../jbroadway/urlify" - }, - { - "name": "mlocati/ip-lib", - "version": "1.17.0", - "version_normalized": "1.17.0.0", - "source": { - "type": "git", - "url": "https://github.com/mlocati/ip-lib.git", - "reference": "db9552c3460d5fa19a4c8183767fe89da7752a4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/mlocati/ip-lib/zipball/db9552c3460d5fa19a4c8183767fe89da7752a4e", - "reference": "db9552c3460d5fa19a4c8183767fe89da7752a4e", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "ext-pdo_sqlite": "*", - "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.5 || ^9.5" - }, - "time": "2021-08-03T15:42:09+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "psr-4": { - "IPLib\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Michele Locati", - "email": "mlocati@gmail.com", - "homepage": "https://github.com/mlocati", - "role": "Author" - } - ], - "description": "Handle IPv4, IPv6 addresses and ranges", - "homepage": "https://github.com/mlocati/ip-lib", - "keywords": [ - "IP", - "address", - "addresses", - "ipv4", - "ipv6", - "manage", - "managing", - "matching", - "network", - "networking", - "range", - "subnet" - ], - "support": { - "issues": "https://github.com/mlocati/ip-lib/issues", - "source": "https://github.com/mlocati/ip-lib/tree/1.17.0" - }, - "funding": [ - { - "url": "https://github.com/sponsors/mlocati", - "type": "github" - }, - { - "url": "https://paypal.me/mlocati", - "type": "other" - } - ], - "install-path": "../mlocati/ip-lib" - }, - { - "name": "mobiledetect/mobiledetectlib", - "version": "2.8.37", - "version_normalized": "2.8.37.0", - "source": { - "type": "git", - "url": "https://github.com/serbanghita/Mobile-Detect.git", - "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/serbanghita/Mobile-Detect/zipball/9841e3c46f5bd0739b53aed8ac677fa712943df7", - "reference": "9841e3c46f5bd0739b53aed8ac677fa712943df7", - "shasum": "" - }, - "require": { - "php": ">=5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.35||~5.7" - }, - "time": "2021-02-19T21:22:57+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "Mobile_Detect.php" - ], - "psr-0": { - "Detection": "namespaced/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Serban Ghita", - "email": "serbanghita@gmail.com", - "homepage": "http://mobiledetect.net", - "role": "Developer" - } - ], - "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.", - "homepage": "https://github.com/serbanghita/Mobile-Detect", - "keywords": [ - "detect mobile devices", - "mobile", - "mobile detect", - "mobile detector", - "php mobile detect" - ], - "support": { - "issues": "https://github.com/serbanghita/Mobile-Detect/issues", - "source": "https://github.com/serbanghita/Mobile-Detect/tree/2.8.37" - }, - "funding": [ - { - "url": "https://github.com/serbanghita", - "type": "github" - } - ], - "install-path": "../mobiledetect/mobiledetectlib" - }, - { - "name": "phpmailer/phpmailer", - "version": "v6.5.0", - "version_normalized": "6.5.0.0", - "source": { - "type": "git", - "url": "https://github.com/PHPMailer/PHPMailer.git", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/PHPMailer/PHPMailer/zipball/a5b5c43e50b7fba655f793ad27303cd74c57363c", - "reference": "a5b5c43e50b7fba655f793ad27303cd74c57363c", - "shasum": "" - }, - "require": { - "ext-ctype": "*", - "ext-filter": "*", - "ext-hash": "*", - "php": ">=5.5.0" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", - "phpcompatibility/php-compatibility": "^9.3.5", - "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" - }, - "suggest": { - "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", - "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", - "league/oauth2-google": "Needed for Google XOAUTH2 authentication", - "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "Needed for Microsoft XOAUTH2 authentication", - "symfony/polyfill-mbstring": "To support UTF-8 if the Mbstring PHP extension is not enabled (^1.2)" - }, - "time": "2021-06-16T14:33:43+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.5.0" - }, - "funding": [ - { - "url": "https://github.com/Synchro", - "type": "github" - } - ], - "install-path": "../phpmailer/phpmailer" - }, - { - "name": "tijsverkoyen/akismet", - "version": "1.1.1", - "version_normalized": "1.1.1.0", - "source": { - "type": "git", - "url": "https://github.com/tijsverkoyen/Akismet.git", - "reference": "6f7987fe181fd0fddbc9832f2ddeaf088425c83f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/tijsverkoyen/Akismet/zipball/6f7987fe181fd0fddbc9832f2ddeaf088425c83f", - "reference": "6f7987fe181fd0fddbc9832f2ddeaf088425c83f", - "shasum": "" - }, - "require": { - "ext-curl": "*", - "php": ">=5.2.0" - }, - "time": "2016-07-19T13:50:18+00:00", - "type": "library", - "installation-source": "dist", - "autoload": { - "classmap": [ - "" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD" - ], - "authors": [ - { - "name": "Tijs Verkoyen", - "email": "akismet@verkoyen.eu", - "role": "Developer" - } - ], - "description": "Akismet is a wrapper-class to communicate with the Akismet API.", - "homepage": "https://github.com/tijsverkoyen/Akismet", - "install-path": "../tijsverkoyen/akismet" - } - ], - "dev": true, - "dev-package-names": [] -} diff --git a/app/vendor/composer/installed.php b/app/vendor/composer/installed.php deleted file mode 100644 index 042e20b..0000000 --- a/app/vendor/composer/installed.php +++ /dev/null @@ -1,68 +0,0 @@ - array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../../', - 'aliases' => array(), - 'reference' => '4c577af004a6a2463d0dcfce078bcb2ff18457f4', - 'name' => 'chevereto/chevereto-free', - 'dev' => true, - ), - 'versions' => array( - 'chevereto/chevereto-free' => array( - 'pretty_version' => 'dev-master', - 'version' => 'dev-master', - 'type' => 'project', - 'install_path' => __DIR__ . '/../../../', - 'aliases' => array(), - 'reference' => '4c577af004a6a2463d0dcfce078bcb2ff18457f4', - 'dev_requirement' => false, - ), - 'jbroadway/urlify' => array( - 'pretty_version' => '1.1.3-stable', - 'version' => '1.1.3.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../jbroadway/urlify', - 'aliases' => array(), - 'reference' => '37fe4e7680a1c8cd68ac43a27dac7ef4be476300', - 'dev_requirement' => false, - ), - 'mlocati/ip-lib' => array( - 'pretty_version' => '1.17.0', - 'version' => '1.17.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mlocati/ip-lib', - 'aliases' => array(), - 'reference' => 'db9552c3460d5fa19a4c8183767fe89da7752a4e', - 'dev_requirement' => false, - ), - 'mobiledetect/mobiledetectlib' => array( - 'pretty_version' => '2.8.37', - 'version' => '2.8.37.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../mobiledetect/mobiledetectlib', - 'aliases' => array(), - 'reference' => '9841e3c46f5bd0739b53aed8ac677fa712943df7', - 'dev_requirement' => false, - ), - 'phpmailer/phpmailer' => array( - 'pretty_version' => 'v6.5.0', - 'version' => '6.5.0.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../phpmailer/phpmailer', - 'aliases' => array(), - 'reference' => 'a5b5c43e50b7fba655f793ad27303cd74c57363c', - 'dev_requirement' => false, - ), - 'tijsverkoyen/akismet' => array( - 'pretty_version' => '1.1.1', - 'version' => '1.1.1.0', - 'type' => 'library', - 'install_path' => __DIR__ . '/../tijsverkoyen/akismet', - 'aliases' => array(), - 'reference' => '6f7987fe181fd0fddbc9832f2ddeaf088425c83f', - 'dev_requirement' => false, - ), - ), -); diff --git a/app/vendor/jbroadway/urlify/.gitignore b/app/vendor/jbroadway/urlify/.gitignore deleted file mode 100644 index 7709e3e..0000000 --- a/app/vendor/jbroadway/urlify/.gitignore +++ /dev/null @@ -1,4 +0,0 @@ -vendor -composer.phar -composer.lock -.idea \ No newline at end of file diff --git a/app/vendor/jbroadway/urlify/.travis.yml b/app/vendor/jbroadway/urlify/.travis.yml deleted file mode 100644 index 66b358e..0000000 --- a/app/vendor/jbroadway/urlify/.travis.yml +++ /dev/null @@ -1,16 +0,0 @@ -language: php - -php: - - 5.4 - - 5.5 - - 5.6 - - 7.0 - - 7.1 - - 7.2 - - 7.3 - -before_script: - - composer install --no-interaction --prefer-source - -script: - - vendor/bin/phpunit --coverage-text --verbose diff --git a/app/vendor/jbroadway/urlify/INSTALL b/app/vendor/jbroadway/urlify/INSTALL deleted file mode 100644 index 92e1bb0..0000000 --- a/app/vendor/jbroadway/urlify/INSTALL +++ /dev/null @@ -1,13 +0,0 @@ -To install URLify, you can add it as a dependency by downloading Composer, the PHP package manager. - -`$ curl -s http://getcomposer.org/installer | php` - -Then run this command to install Composer: - -`$ php composer.phar install` - -For more details, see https://getcomposer.org/ - -Then run this command to install the URLify library: - -`$ composer require jbroadway/urlify` diff --git a/app/vendor/jbroadway/urlify/LICENSE b/app/vendor/jbroadway/urlify/LICENSE deleted file mode 100644 index 5f4f225..0000000 --- a/app/vendor/jbroadway/urlify/LICENSE +++ /dev/null @@ -1,27 +0,0 @@ -Copyright (c) Django Software Foundation and individual contributors. -All rights reserved. - -Redistribution and use in source and binary forms, with or without modification, -are permitted provided that the following conditions are met: - - 1. Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in the - documentation and/or other materials provided with the distribution. - - 3. Neither the name of Django nor the names of its contributors may be used - to endorse or promote products derived from this software without - specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND -ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR -ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON -ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT -(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/app/vendor/jbroadway/urlify/README.md b/app/vendor/jbroadway/urlify/README.md deleted file mode 100644 index e5aaa86..0000000 --- a/app/vendor/jbroadway/urlify/README.md +++ /dev/null @@ -1,90 +0,0 @@ -# URLify for PHP [![Build Status](https://travis-ci.org/jbroadway/urlify.png)](https://travis-ci.org/jbroadway/urlify) - -A PHP port of [URLify.js](https://github.com/django/django/blob/master/django/contrib/admin/static/admin/js/urlify.js) -from the Django project. Handles symbols from Latin languages as well as Arabic, Azerbaijani, Czech, German, Greek, Kazakh, -Latvian, Lithuanian, Persian, Polish, Romanian, Bulgarian, Russian, Serbian, Turkish, Ukrainian, Vietnamese and Slovak. Symbols it cannot -transliterate it will simply omit. - -## Installation - -Install the latest version with: - -```bash -$ composer require jbroadway/urlify -``` - -## Usage - -To generate slugs for URLs: - -```php - '?', '®' => '(r)', '¼' => '1/4', - '½' => '1/2', '¾' => '3/4', '¶' => 'P' -]); - -echo URLify::downcode ('¿ ® ¼ ¼ ¾ ¶'); -// "? (r) 1/2 1/2 3/4 P" -``` - -To extend the list of words to remove: - -```php - array ( /* German */ - 'Ä' => 'Ae', 'Ö' => 'Oe', 'Ü' => 'Ue', 'ä' => 'ae', 'ö' => 'oe', 'ü' => 'ue', 'ß' => 'ss', - 'ẞ' => 'SS' - ), - 'latin' => array ( - 'À' => 'A', 'Á' => 'A', 'Â' => 'A', 'Ã' => 'A', 'Ä' => 'A', 'Å' => 'A','Ă' => 'A', 'Æ' => 'AE', 'Ç' => - 'C', 'È' => 'E', 'É' => 'E', 'Ê' => 'E', 'Ë' => 'E', 'Ì' => 'I', 'Í' => 'I', 'Î' => 'I', - 'Ï' => 'I', 'Ð' => 'D', 'Ñ' => 'N', 'Ò' => 'O', 'Ó' => 'O', 'Ô' => 'O', 'Õ' => 'O', 'Ö' => - 'O', 'Ő' => 'O', 'Ø' => 'O', 'Œ' => 'OE' ,'Ș' => 'S','Ț' => 'T', 'Ù' => 'U', 'Ú' => 'U', 'Û' => 'U', 'Ü' => 'U', 'Ű' => 'U', - 'Ý' => 'Y', 'Þ' => 'TH', 'ß' => 'ss', 'à' => 'a', 'á' => 'a', 'â' => 'a', 'ã' => 'a', 'ä' => - 'a', 'å' => 'a', 'ă' => 'a', 'æ' => 'ae', 'ç' => 'c', 'è' => 'e', 'é' => 'e', 'ê' => 'e', 'ë' => 'e', - 'ì' => 'i', 'í' => 'i', 'î' => 'i', 'ï' => 'i', 'ð' => 'd', 'ñ' => 'n', 'ò' => 'o', 'ó' => - 'o', 'ô' => 'o', 'õ' => 'o', 'ö' => 'o', 'ő' => 'o', 'ø' => 'o', 'œ' => 'oe', 'ș' => 's', 'ț' => 't', 'ù' => 'u', 'ú' => 'u', - 'û' => 'u', 'ü' => 'u', 'ű' => 'u', 'ý' => 'y', 'þ' => 'th', 'ÿ' => 'y' - ), - 'latin_symbols' => array ( - '©' => '(c)' - ), - 'el' => array ( /* Greek */ - 'α' => 'a', 'β' => 'b', 'γ' => 'g', 'δ' => 'd', 'ε' => 'e', 'ζ' => 'z', 'η' => 'h', 'θ' => '8', - 'ι' => 'i', 'κ' => 'k', 'λ' => 'l', 'μ' => 'm', 'ν' => 'n', 'ξ' => '3', 'ο' => 'o', 'π' => 'p', - 'ρ' => 'r', 'σ' => 's', 'τ' => 't', 'υ' => 'y', 'φ' => 'f', 'χ' => 'x', 'ψ' => 'ps', 'ω' => 'w', - 'ά' => 'a', 'έ' => 'e', 'ί' => 'i', 'ό' => 'o', 'ύ' => 'y', 'ή' => 'h', 'ώ' => 'w', 'ς' => 's', - 'ϊ' => 'i', 'ΰ' => 'y', 'ϋ' => 'y', 'ΐ' => 'i', - 'Α' => 'A', 'Β' => 'B', 'Γ' => 'G', 'Δ' => 'D', 'Ε' => 'E', 'Ζ' => 'Z', 'Η' => 'H', 'Θ' => '8', - 'Ι' => 'I', 'Κ' => 'K', 'Λ' => 'L', 'Μ' => 'M', 'Ν' => 'N', 'Ξ' => '3', 'Ο' => 'O', 'Π' => 'P', - 'Ρ' => 'R', 'Σ' => 'S', 'Τ' => 'T', 'Υ' => 'Y', 'Φ' => 'F', 'Χ' => 'X', 'Ψ' => 'PS', 'Ω' => 'W', - 'Ά' => 'A', 'Έ' => 'E', 'Ί' => 'I', 'Ό' => 'O', 'Ύ' => 'Y', 'Ή' => 'H', 'Ώ' => 'W', 'Ϊ' => 'I', - 'Ϋ' => 'Y' - ), - 'tr' => array ( /* Turkish */ - 'ş' => 's', 'Ş' => 'S', 'ı' => 'i', 'İ' => 'I', 'ç' => 'c', 'Ç' => 'C', 'ü' => 'u', 'Ü' => 'U', - 'ö' => 'o', 'Ö' => 'O', 'ğ' => 'g', 'Ğ' => 'G' - ), - 'bg' => array( /* Bulgarian */ - 'Щ' => 'Sht', 'Ш' => 'Sh', 'Ч' => 'Ch', 'Ц' => 'C', 'Ю' => 'Yu', 'Я' => 'Ya', - 'Ж' => 'J', 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', - 'Е' => 'E', 'З' => 'Z', 'И' => 'I', 'Й' => 'Y', 'К' => 'K', 'Л' => 'L', - 'М' => 'M', 'Н' => 'N', 'О' => 'O', 'П' => 'P', 'Р' => 'R', 'С' => 'S', - 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ь' => '', 'Ъ' => 'A', - 'щ' => 'sht', 'ш' => 'sh', 'ч' => 'ch', 'ц' => 'c', 'ю' => 'yu', 'я' => 'ya', - 'ж' => 'j', 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', - 'е' => 'e', 'з' => 'z', 'и' => 'i', 'й' => 'y', 'к' => 'k', 'л' => 'l', - 'м' => 'm', 'н' => 'n', 'о' => 'o', 'п' => 'p', 'р' => 'r', 'с' => 's', - 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ь' => '', 'ъ' => 'a' - ), - 'ru' => array ( /* Russian */ - 'а' => 'a', 'б' => 'b', 'в' => 'v', 'г' => 'g', 'д' => 'd', 'е' => 'e', 'ё' => 'yo', 'ж' => 'zh', - 'з' => 'z', 'и' => 'i', 'й' => 'i', 'к' => 'k', 'л' => 'l', 'м' => 'm', 'н' => 'n', 'о' => 'o', - 'п' => 'p', 'р' => 'r', 'с' => 's', 'т' => 't', 'у' => 'u', 'ф' => 'f', 'х' => 'h', 'ц' => 'c', - 'ч' => 'ch', 'ш' => 'sh', 'щ' => 'sh', 'ъ' => '', 'ы' => 'y', 'ь' => '', 'э' => 'e', 'ю' => 'yu', - 'я' => 'ya', - 'А' => 'A', 'Б' => 'B', 'В' => 'V', 'Г' => 'G', 'Д' => 'D', 'Е' => 'E', 'Ё' => 'Yo', 'Ж' => 'Zh', - 'З' => 'Z', 'И' => 'I', 'Й' => 'I', 'К' => 'K', 'Л' => 'L', 'М' => 'M', 'Н' => 'N', 'О' => 'O', - 'П' => 'P', 'Р' => 'R', 'С' => 'S', 'Т' => 'T', 'У' => 'U', 'Ф' => 'F', 'Х' => 'H', 'Ц' => 'C', - 'Ч' => 'Ch', 'Ш' => 'Sh', 'Щ' => 'Sh', 'Ъ' => '', 'Ы' => 'Y', 'Ь' => '', 'Э' => 'E', 'Ю' => 'Yu', - 'Я' => 'Ya', - '№' => '' - ), - 'uk' => array ( /* Ukrainian */ - 'Є' => 'Ye', 'І' => 'I', 'Ї' => 'Yi', 'Ґ' => 'G', 'є' => 'ye', 'і' => 'i', 'ї' => 'yi', 'ґ' => 'g' - ), - 'kk' => array ( /* Kazakh */ - 'Ә' => 'A', 'Ғ' => 'G', 'Қ' => 'Q', 'Ң' => 'N', 'Ө' => 'O', 'Ұ' => 'U', 'Ү' => 'U', 'Һ' => 'H', - 'ә' => 'a', 'ғ' => 'g', 'қ' => 'q', 'ң' => 'n', 'ө' => 'o', 'ұ' => 'u', 'ү' => 'u', 'һ' => 'h', - ), - 'cs' => array ( /* Czech */ - 'č' => 'c', 'ď' => 'd', 'ě' => 'e', 'ň' => 'n', 'ř' => 'r', 'š' => 's', 'ť' => 't', 'ů' => 'u', - 'ž' => 'z', 'Č' => 'C', 'Ď' => 'D', 'Ě' => 'E', 'Ň' => 'N', 'Ř' => 'R', 'Š' => 'S', 'Ť' => 'T', - 'Ů' => 'U', 'Ž' => 'Z' - ), - 'pl' => array ( /* Polish */ - 'ą' => 'a', 'ć' => 'c', 'ę' => 'e', 'ł' => 'l', 'ń' => 'n', 'ó' => 'o', 'ś' => 's', 'ź' => 'z', - 'ż' => 'z', 'Ą' => 'A', 'Ć' => 'C', 'Ę' => 'e', 'Ł' => 'L', 'Ń' => 'N', 'Ó' => 'O', 'Ś' => 'S', - 'Ź' => 'Z', 'Ż' => 'Z' - ), - 'ro' => array ( /* Romanian */ - 'ă' => 'a', 'â' => 'a', 'î' => 'i', 'ș' => 's', 'ț' => 't', 'Ţ' => 'T', 'ţ' => 't' - ), - 'lv' => array ( /* Latvian */ - 'ā' => 'a', 'č' => 'c', 'ē' => 'e', 'ģ' => 'g', 'ī' => 'i', 'ķ' => 'k', 'ļ' => 'l', 'ņ' => 'n', - 'š' => 's', 'ū' => 'u', 'ž' => 'z', 'Ā' => 'A', 'Č' => 'C', 'Ē' => 'E', 'Ģ' => 'G', 'Ī' => 'i', - 'Ķ' => 'k', 'Ļ' => 'L', 'Ņ' => 'N', 'Š' => 'S', 'Ū' => 'u', 'Ž' => 'Z' - ), - 'lt' => array ( /* Lithuanian */ - 'ą' => 'a', 'č' => 'c', 'ę' => 'e', 'ė' => 'e', 'į' => 'i', 'š' => 's', 'ų' => 'u', 'ū' => 'u', 'ž' => 'z', - 'Ą' => 'A', 'Č' => 'C', 'Ę' => 'E', 'Ė' => 'E', 'Į' => 'I', 'Š' => 'S', 'Ų' => 'U', 'Ū' => 'U', 'Ž' => 'Z' - ), - 'vi' => array ( /* Vietnamese */ - 'Á' => 'A', 'À' => 'A', 'Ả' => 'A', 'Ã' => 'A', 'Ạ' => 'A', 'Ă' => 'A', 'Ắ' => 'A', 'Ằ' => 'A', 'Ẳ' => 'A', 'Ẵ' => 'A', 'Ặ' => 'A', 'Â' => 'A', 'Ấ' => 'A', 'Ầ' => 'A', 'Ẩ' => 'A', 'Ẫ' => 'A', 'Ậ' => 'A', - 'á' => 'a', 'à' => 'a', 'ả' => 'a', 'ã' => 'a', 'ạ' => 'a', 'ă' => 'a', 'ắ' => 'a', 'ằ' => 'a', 'ẳ' => 'a', 'ẵ' => 'a', 'ặ' => 'a', 'â' => 'a', 'ấ' => 'a', 'ầ' => 'a', 'ẩ' => 'a', 'ẫ' => 'a', 'ậ' => 'a', - 'É' => 'E', 'È' => 'E', 'Ẻ' => 'E', 'Ẽ' => 'E', 'Ẹ' => 'E', 'Ê' => 'E', 'Ế' => 'E', 'Ề' => 'E', 'Ể' => 'E', 'Ễ' => 'E', 'Ệ' => 'E', - 'é' => 'e', 'è' => 'e', 'ẻ' => 'e', 'ẽ' => 'e', 'ẹ' => 'e', 'ê' => 'e', 'ế' => 'e', 'ề' => 'e', 'ể' => 'e', 'ễ' => 'e', 'ệ' => 'e', - 'Í' => 'I', 'Ì' => 'I', 'Ỉ' => 'I', 'Ĩ' => 'I', 'Ị' => 'I', 'í' => 'i', 'ì' => 'i', 'ỉ' => 'i', 'ĩ' => 'i', 'ị' => 'i', - 'Ó' => 'O', 'Ò' => 'O', 'Ỏ' => 'O', 'Õ' => 'O', 'Ọ' => 'O', 'Ô' => 'O', 'Ố' => 'O', 'Ồ' => 'O', 'Ổ' => 'O', 'Ỗ' => 'O', 'Ộ' => 'O', 'Ơ' => 'O', 'Ớ' => 'O', 'Ờ' => 'O', 'Ở' => 'O', 'Ỡ' => 'O', 'Ợ' => 'O', - 'ó' => 'o', 'ò' => 'o', 'ỏ' => 'o', 'õ' => 'o', 'ọ' => 'o', 'ô' => 'o', 'ố' => 'o', 'ồ' => 'o', 'ổ' => 'o', 'ỗ' => 'o', 'ộ' => 'o', 'ơ' => 'o', 'ớ' => 'o', 'ờ' => 'o', 'ở' => 'o', 'ỡ' => 'o', 'ợ' => 'o', - 'Ú' => 'U', 'Ù' => 'U', 'Ủ' => 'U', 'Ũ' => 'U', 'Ụ' => 'U', 'Ư' => 'U', 'Ứ' => 'U', 'Ừ' => 'U', 'Ử' => 'U', 'Ữ' => 'U', 'Ự' => 'U', - 'ú' => 'u', 'ù' => 'u', 'ủ' => 'u', 'ũ' => 'u', 'ụ' => 'u', 'ư' => 'u', 'ứ' => 'u', 'ừ' => 'u', 'ử' => 'u', 'ữ' => 'u', 'ự' => 'u', - 'Ý' => 'Y', 'Ỳ' => 'Y', 'Ỷ' => 'Y', 'Ỹ' => 'Y', 'Ỵ' => 'Y', 'ý' => 'y', 'ỳ' => 'y', 'ỷ' => 'y', 'ỹ' => 'y', 'ỵ' => 'y', - 'Đ' => 'D', 'đ' => 'd' - ), - 'ar' => array ( /* Arabic */ - 'أ' => 'a', 'ب' => 'b', 'ت' => 't', 'ث' => 'th', 'ج' => 'g', 'ح' => 'h', 'خ' => 'kh', 'د' => 'd', - 'ذ' => 'th', 'ر' => 'r', 'ز' => 'z', 'س' => 's', 'ش' => 'sh', 'ص' => 's', 'ض' => 'd', 'ط' => 't', - 'ظ' => 'th', 'ع' => 'aa', 'غ' => 'gh', 'ف' => 'f', 'ق' => 'k', 'ك' => 'k', 'ل' => 'l', 'م' => 'm', - 'ن' => 'n', 'ه' => 'h', 'و' => 'o', 'ي' => 'y', - 'ا' => 'a', 'إ' => 'a', 'آ' => 'a', 'ؤ' => 'o', 'ئ' => 'y', 'ء' => 'aa', - '٠' => '0', '١' => '1', '٢' => '2', '٣' => '3', '٤' => '4', '٥' => '5', '٦' => '6', '٧' => '7', '٨' => '8', '٩' => '9', - ), - 'fa' => array ( /* Persian */ - 'گ' => 'g', 'ژ' => 'j', 'پ' => 'p', 'چ' => 'ch', 'ی' => 'y', 'ک' => 'k', - '۰' => '0', '۱' => '1', '۲' => '2', '۳' => '3', '۴' => '4', '۵' => '5', '۶' => '6', '۷' => '7', '۸' => '8', '۹' => '9', - ), - 'sr' => array ( /* Serbian */ - 'ђ' => 'dj', 'ј' => 'j', 'љ' => 'lj', 'њ' => 'nj', 'ћ' => 'c', 'џ' => 'dz', 'đ' => 'dj', - 'Ђ' => 'Dj', 'Ј' => 'j', 'Љ' => 'Lj', 'Њ' => 'Nj', 'Ћ' => 'C', 'Џ' => 'Dz', 'Đ' => 'Dj' - ), - 'az' => array ( /* Azerbaijani */ - 'ç' => 'c', 'ə' => 'e', 'ğ' => 'g', 'ı' => 'i', 'ö' => 'o', 'ş' => 's', 'ü' => 'u', - 'Ç' => 'C', 'Ə' => 'E', 'Ğ' => 'G', 'İ' => 'I', 'Ö' => 'O', 'Ş' => 'S', 'Ü' => 'U' - ), - 'sk' => array ( /* Slovak */ - 'ĺ' => 'l', 'ľ' => 'l', 'ŕ' => 'r' - ) - ); - - /** - * List of words to remove from URLs. - */ - public static $remove_list = array ( - 'a', 'an', 'as', 'at', 'before', 'but', 'by', 'for', 'from', - 'is', 'in', 'into', 'like', 'of', 'off', 'on', 'onto', 'per', - 'since', 'than', 'the', 'this', 'that', 'to', 'up', 'via', - 'with' - ); - - /** - * The character map. - */ - private static $map = array (); - - /** - * The character list as a string. - */ - private static $chars = ''; - - /** - * The character list as a regular expression. - */ - private static $regex = ''; - - /** - * The current language - */ - private static $language = ''; - - /** - * Initializes the character map. - * @param string $language - */ - private static function init ($language = "") - { - if (count (self::$map) > 0 && (($language == "") || ($language == self::$language))) { - return; - } - - /* Is a specific map associated with $language ? */ - if (isset(self::$maps[$language]) && is_array(self::$maps[$language])) { - /* Move this map to end. This means it will have priority over others */ - $m = self::$maps[$language]; - unset(self::$maps[$language]); - self::$maps[$language] = $m; - } - /* Reset static vars */ - self::$language = $language; - self::$map = array(); - self::$chars = ''; - - foreach (self::$maps as $map) { - foreach ($map as $orig => $conv) { - self::$map[$orig] = $conv; - self::$chars .= $orig; - } - } - - self::$regex = '/[' . preg_quote(self::$chars, '/') . ']/u'; - } - - /** - * Add new characters to the list. `$map` should be a hash. - * @param array $map - */ - public static function add_chars ($map) - { - if (! is_array ($map)) { - throw new LogicException ('$map must be an associative array.'); - } - self::$maps[] = $map; - self::$map = array (); - self::$chars = ''; - } - - /** - * Append words to the remove list. Accepts either single words - * or an array of words. - * @param mixed $words - */ - public static function remove_words ($words) - { - $words = is_array ($words) ? $words : array ($words); - self::$remove_list = array_unique (array_merge (self::$remove_list, $words)); - } - - /** - * Transliterates characters to their ASCII equivalents. - * $language specifies a priority for a specific language. - * The latter is useful if languages have different rules for the same character. - * @param string $text - * @param string $language - * @return string - */ - public static function downcode ($text, $language = "") - { - self::init ($language); - - if (preg_match_all (self::$regex, $text, $matches)) { - for ($i = 0; $i < count ($matches[0]); $i++) { - $char = $matches[0][$i]; - if (isset (self::$map[$char])) { - $text = str_replace ($char, self::$map[$char], $text); - } - } - } - return $text; - } - - /** - * Filters a string, e.g., "Petty theft" to "petty-theft" - * @param string $text The text to return filtered - * @param int $length The length (after filtering) of the string to be returned - * @param string $language The transliteration language, passed down to downcode() - * @param bool $file_name Whether there should be and additional filter considering this is a filename - * @param bool $use_remove_list Whether you want to remove specific elements previously set in self::$remove_list - * @param bool $lower_case Whether you want the filter to maintain casing or lowercase everything (default) - * @param bool $treat_underscore_as_space Treat underscore as space, so it will replaced with "-" - * @return string - */ - public static function filter ($text, $length = 60, $language = "", $file_name = false, $use_remove_list = true, $lower_case = true, $treat_underscore_as_space = true) - { - $text = self::downcode ($text,$language); - - if ($use_remove_list) { - // remove all these words from the string before urlifying - $text = preg_replace ('/\b(' . join ('|', self::$remove_list) . ')\b/i', '', $text); - } - - // if downcode doesn't hit, the char will be stripped here - $remove_pattern = ($file_name) ? '/[^_\-.\-a-zA-Z0-9\s]/u' : '/[^\s_\-a-zA-Z0-9]/u'; - $text = preg_replace ($remove_pattern, '', $text); // remove unneeded chars - if ($treat_underscore_as_space) { - $text = str_replace ('_', ' ', $text); // treat underscores as spaces - } - $text = preg_replace ('/^\s+|\s+$/u', '', $text); // trim leading/trailing spaces - $text = preg_replace ('/[-\s]+/u', '-', $text); // convert spaces to hyphens - if ($lower_case) { - $text = strtolower ($text); // convert to lowercase - } - - return trim (substr ($text, 0, $length), '-'); // trim to first $length chars - } - - /** - * Alias of `URLify::downcode()`. - */ - public static function transliterate ($text) - { - return self::downcode ($text); - } -} diff --git a/app/vendor/jbroadway/urlify/composer.json b/app/vendor/jbroadway/urlify/composer.json deleted file mode 100644 index 38846a2..0000000 --- a/app/vendor/jbroadway/urlify/composer.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "name": "jbroadway/urlify", - "type": "library", - "description": "PHP port of URLify.js from the Django project. Transliterates non-ascii characters for use in URLs.", - "keywords": ["urlify","transliterate","translit","transliteration","url","encode","slug","link","iconv"], - "homepage": "https://github.com/jbroadway/urlify", - "license": "BSD-3-Clause-Clear", - "authors": [ - { - "name": "Johnny Broadway", - "email": "johnny@johnnybroadway.com", - "homepage": "http://www.johnnybroadway.com/" - } - ], - "require": { - "php": ">=5.3.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^5.7 || ^6.5" - }, - "autoload": { - "psr-0": { "URLify": "" } - }, - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - } -} diff --git a/app/vendor/jbroadway/urlify/phpunit.xml b/app/vendor/jbroadway/urlify/phpunit.xml deleted file mode 100644 index eeebfcc..0000000 --- a/app/vendor/jbroadway/urlify/phpunit.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - tests - - - - - diff --git a/app/vendor/jbroadway/urlify/scripts/downcode.php b/app/vendor/jbroadway/urlify/scripts/downcode.php deleted file mode 100644 index f2a7fda..0000000 --- a/app/vendor/jbroadway/urlify/scripts/downcode.php +++ /dev/null @@ -1,20 +0,0 @@ - 2) { - die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); -} - -//Process the provided argument -if($argc === 2) { - $s = $argv[1]; -//Or read from stdin if the argument wasn't present -} else { - $piped = true; - $s = file_get_contents("php://stdin"); -} - -echo URLify::downcode ($s) . ($piped ? "\n" : ""); diff --git a/app/vendor/jbroadway/urlify/scripts/filter.php b/app/vendor/jbroadway/urlify/scripts/filter.php deleted file mode 100644 index aec6a0a..0000000 --- a/app/vendor/jbroadway/urlify/scripts/filter.php +++ /dev/null @@ -1,20 +0,0 @@ - 2) { - die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); -} - -//Process the provided argument -if($argc === 2) { - $s = $argv[1]; -//Or read from stdin if the argument wasn't present -} else { - $piped = true; - $s = file_get_contents("php://stdin"); -} - -echo URLify::filter ($s) . ($piped ? "\n" : ""); diff --git a/app/vendor/jbroadway/urlify/scripts/transliterate.php b/app/vendor/jbroadway/urlify/scripts/transliterate.php deleted file mode 100644 index 258581b..0000000 --- a/app/vendor/jbroadway/urlify/scripts/transliterate.php +++ /dev/null @@ -1,20 +0,0 @@ - 2) { - die ("Usage (argument): php " . basename(__FILE__) . " \"\"\nUsage (pipe): | php " . basename(__FILE__) . "\n"); -} - -//Process the provided argument -if($argc === 2) { - $s = $argv[1]; -//Or read from stdin if the argument wasn't present -} else { - $piped = true; - $s = file_get_contents("php://stdin"); -} - -echo URLify::transliterate($s) . ($piped ? "\n" : ""); diff --git a/app/vendor/jbroadway/urlify/tests/URLifyTest.php b/app/vendor/jbroadway/urlify/tests/URLifyTest.php deleted file mode 100644 index aa3ac30..0000000 --- a/app/vendor/jbroadway/urlify/tests/URLifyTest.php +++ /dev/null @@ -1,60 +0,0 @@ -assertEquals (' J\'etudie le francais ', URLify::downcode (' J\'étudie le français ')); - $this->assertEquals ('Lo siento, no hablo espanol.', URLify::downcode ('Lo siento, no hablo español.')); - $this->assertEquals ('F3PWS', URLify::downcode ('ΦΞΠΏΣ')); - $this->assertEquals ('foo-bar', URLify::filter ('_foo_bar_')); - } - - function test_filter () { - $this->assertEquals ('jetudie-le-francais', URLify::filter (' J\'étudie le français ')); - $this->assertEquals ('lo-siento-no-hablo-espanol', URLify::filter ('Lo siento, no hablo español.')); - $this->assertEquals ('f3pws', URLify::filter ('ΦΞΠΏΣ')); - $this->assertEquals ('', URLify::filter('大般若經')); - $this->assertEquals ('test-.txt', URLify::filter('test-大般若經.txt', 60, "", $file_name = true)); - $this->assertEquals ('yakrhy-ltoytr', URLify::filter('ياكرهي لتويتر')); - $this->assertEquals ('saaat-25', URLify::filter('ساعت ۲۵')); - $this->assertEquals ('foto.jpg', URLify::filter ('фото.jpg', 60, "", $file_name = true)); - // priorization of language-specific maps - $this->assertEquals ('aouaou', URLify::filter ('ÄÖÜäöü',60,"tr")); - $this->assertEquals ('aeoeueaeoeue', URLify::filter ('ÄÖÜäöü',60,"de")); - - $this->assertEquals ('bobby-mcferrin-dont-worry-be-happy', URLify::filter ("Bobby McFerrin — Don't worry be happy",600,"en")); - // test stripping and conversion of UTF-8 spaces - $this->assertEquals ('test-mahito-mukai', URLify::filter('向井 真人test (Mahito Mukai)')); - // Treat underscore as space - $this->assertEquals ('text_with_underscore', URLify::filter('text_with_underscore', 60, "en", true, true, true, false)); - } - - function test_add_chars () { - $this->assertEquals ('¿ ® ¼ ¼ ¾ ¶', URLify::downcode ('¿ ® ¼ ¼ ¾ ¶')); - URLify::add_chars (array ( - '¿' => '?', '®' => '(r)', '¼' => '1/4', - '¼' => '1/2', '¾' => '3/4', '¶' => 'P' - )); - $this->assertEquals ('? (r) 1/2 1/2 3/4 P', URLify::downcode ('¿ ® ¼ ¼ ¾ ¶')); - } - - function test_remove_words () { - $this->assertEquals ('foo-bar', URLify::filter ('foo bar')); - URLify::remove_words (array ('foo', 'bar')); - $this->assertEquals ('', URLify::filter ('foo bar')); - } - - function test_many_rounds_with_unknown_language_code () { - for ($i = 0; $i < 1000; $i++) { - URLify::downcode ('Lo siento, no hablo español.',-1); - } - } - - function test_remove_words_disable () { - URLify::remove_words (array ('foo', 'bar')); - $this->assertEquals ('foo-bar', URLify::filter ('foo bar', 60, '', false, false)); - } -} - -?> diff --git a/app/vendor/jbroadway/urlify/tests/bootstrap.php b/app/vendor/jbroadway/urlify/tests/bootstrap.php deleted file mode 100644 index d56d466..0000000 --- a/app/vendor/jbroadway/urlify/tests/bootstrap.php +++ /dev/null @@ -1,9 +0,0 @@ -getPreviousAddress(); - -// This will print ::2 -echo (string) $address->getNextAddress(); -``` - -### Get the addresses at a specified offset - -For addresses: - -```php -$address = \IPLib\Factory::parseAddressString('::1'); - -// This will print ::1 -echo (string) $address->getAddressAtOffset(0); - -// This will print ::2 -echo (string) $address->getAddressAtOffset(1); - -// This will print ::3 -echo (string) $address->getAddressAtOffset(2); - -// This will print ::3e9 -echo (string) $address->getAddressAtOffset(1000); - -// This will print :: -echo (string) $address->getAddressAtOffset(-1); - -// This will print NULL -echo var_dump($address->getAddressAtOffset(-2)); -``` - -For ranges: - -```php -$range = \IPLib\Factory::parseRangeString('::ff00/120'); - -// This will print ::ff00 -echo (string) $range->getAddressAtOffset(0); - -// This will print ::ff10 -echo (string) $range->getAddressAtOffset(16); - -// This will print ::ff64 -echo (string) $range->getAddressAtOffset(100); - -// This will print NULL because the address ::1:0 is out of the range -var_dump($range->getAddressAtOffset(256)); - -// This will print ::ffff -echo (string) $range->getAddressAtOffset(-1); - -// This will print ::fff0 -echo (string) $range->getAddressAtOffset(-16); - -// This will print ::ff00 -echo (string) $range->getAddressAtOffset(-256); - -// This will print NULL because the address ::feff is out of the range -var_dump($range->getAddressAtOffset(-257)); -``` - -### Parse an IP address range - -To parse a subnet (CIDR) range: - -```php -$range = \IPLib\Range\Subnet::parseString('127.0.0.1/24'); -$range = \IPLib\Range\Subnet::parseString('::1/128'); -``` - -To parse a pattern (asterisk notation) range: - -```php -$range = \IPLib\Range\Pattern::parseString('127.0.0.*'); -$range = \IPLib\Range\Pattern::parseString('::*'); -``` - -To parse an andress as a range: - -```php -$range = \IPLib\Range\Single::parseString('127.0.0.1'); -$range = \IPLib\Range\Single::parseString('::1'); -``` - -To parse a range in any format: - -```php -$range = \IPLib\Factory::parseRangeString('127.0.0.*'); -$range = \IPLib\Factory::parseRangeString('::1/128'); -$range = \IPLib\Factory::parseRangeString('::'); -``` - -### Retrieve a range from its boundaries - -You can calculate the smallest range that comprises two addresses: - -```php -$range = \IPLib\Factory::getRangeFromBoundaries('192.168.0.1', '192.168.255.255'); - -// This will print 192.168.0.0/16 -echo (string) $range; -``` - -You can also calculate a list of ranges that exactly describes all the addresses between two addresses: - -```php -$ranges = \IPLib\Factory::getRangesFromBoundaries('192.168.0.0', '192.168.0.5'); - -// This will print 192.168.0.0/30 192.168.0.4/31 -echo implode(' ', $ranges); -``` - -### Retrieve the boundaries of a range - -```php -$range = \IPLib\Factory::parseRangeString('127.0.0.*'); - -// This will print 127.0.0.0 -echo (string) $range->getStartAddress(); - -// This will print 127.0.0.255 -echo (string) $range->getEndAddress(); -``` - -### Format addresses and ranges - -Both IP addresses and ranges have a `toString` method that you can use to retrieve a textual representation: - -```php -// This will print 127.0.0.1 -echo \IPLib\Factory::parseAddressString('127.0.0.1')->toString(); - -// This will print 127.0.0.1 -echo \IPLib\Factory::parseAddressString('127.000.000.001')->toString(); - -// This will print ::1 -echo \IPLib\Factory::parseAddressString('::1')->toString(); - -// This will print ::1 -echo \IPLib\Factory::parseAddressString('0:0::1')->toString(); - -// This will print ::1/64 -echo \IPLib\Factory::parseRangeString('0:0::1/64')->toString(); -``` - -When working with IPv6, you may want the full (expanded) representation of the addresses. In this case, simply use a `true` parameter for the `toString` method: - -```php -// This will print 0000:0000:0000:0000:0000:0000:0000:0000 -echo \IPLib\Factory::parseAddressString('::')->toString(true); - -// This will print 0000:0000:0000:0000:0000:0000:0000:0001 -echo \IPLib\Factory::parseAddressString('::1')->toString(true); - -// This will print 0fff:0000:0000:0000:0000:0000:0000:0000 -echo \IPLib\Factory::parseAddressString('fff::')->toString(true); - -// This will print 0000:0000:0000:0000:0000:0000:0000:0000 -echo \IPLib\Factory::parseAddressString('::0:0')->toString(true); - -// This will print 0001:0002:0003:0004:0005:0006:0007:0008 -echo \IPLib\Factory::parseAddressString('1:2:3:4:5:6:7:8')->toString(true); - -// This will print 0000:0000:0000:0000:0000:0000:0000:0001/64 -echo \IPLib\Factory::parseRangeString('0:0::1/64')->toString(); -``` - -The address and range objects implements the `__toString()` method, which call the `toString()` method. -So, if you want the string (short) representation of an object, you can do any of the following: - -```php -$address = \IPLib\Address\IPv6::parseString('::1'); - -// All these will print ::1 -echo $address->toString(); -echo $address->toString(false); -echo (string) $address; -``` - -### Check if an address is contained in a range - -All the range types offer a `contains` method, and all the IP address types offer a `matches` method: you can call them to check if an address is contained in a range: - -```php -$address = \IPLib\Factory::parseAddressString('1:2:3:4:5:6:7:8'); -$range = \IPLib\Factory::parseRangeString('0:0::1/64'); - -$contained = $address->matches($range); -// that's equivalent to -$contained = $range->contains($address); -``` - -Please remark that if the address is IPv4 and the range is IPv6 (or vice-versa), the result will always be `false`. - -### Check if a range contains another range - -All the range types offer a `containsRange` method: you can call them to check if an address range fully contains another range: - -```php -$range1 = \IPLib\Factory::parseRangeString('0:0::1/64'); -$range2 = \IPLib\Factory::parseRangeString('0:0::1/65'); - -$contained = $range1->containsRange($range2); -``` - -### Getting the type of an IP address - -If you want to know if an address is within a private network, or if it's a public IP, or whatever you want, you can use the `getRangeType` method: - -```php -$address = \IPLib\Factory::parseAddressString('::'); - -$type = $address->getRangeType(); - -$typeName = \IPLib\Range\Type::getName($type); -``` - -The most notable values of the range type are: - -- `\IPLib\Range\Type::T_UNSPECIFIED` if the address is all zeros (`0.0.0.0` or `::`) -- `\IPLib\Range\Type::T_LOOPBACK` if the address is the localhost (usually `127.0.0.1` or `::1`) -- `\IPLib\Range\Type::T_PRIVATENETWORK` if the address is in the local network (for instance `192.168.0.1` or `fc00::1`) -- `\IPLib\Range\Type::T_PUBLIC` if the address is for public usage (for instance `104.25.25.33` or `2001:503:ba3e::2:30`) - -### Getting the type of an IP address range - -If you want to know the type of an address range, you can use the `getRangeType` method: - -```php -$range = \IPLib\Factory::parseRangeString('2000:0::1/64'); - -// $type will contain the value of \IPLib\Range\Type::T_PUBLIC -$type = $range->getRangeType(); - -// This will print Public address -echo \IPLib\Range\Type::getName($type); -``` - -Please note that if a range spans across multiple range types, you'll get NULL as the range type: - -```php -$range = \IPLib\Factory::parseRangeString('::/127'); - -// $type will contain null -$type = $range->getRangeType(); - -// This will print Unknown type -echo \IPLib\Range\Type::getName($type); -``` - -### Converting IP addresses - -This library supports converting IPv4 to/from IPv6 addresses using the [6to4 notation](https://tools.ietf.org/html/rfc3056) or the [IPv4-mapped notation](https://tools.ietf.org/html/rfc4291#section-2.5.5.2): - -```php -$ipv4 = \IPLib\Factory::parseAddressString('1.2.3.4'); - -// 6to4 notation -$ipv6 = $ipv4->toIPv6(); - -// This will print 2002:102:304:: -echo (string) $ipv6; - -// This will print 1.2.3.4 -echo $ipv6->toIPv4(); - -// IPv4-mapped notation -$ipv6 = $ipv4->toIPv6IPv4Mapped(); - -// This will print ::ffff:1.2.3.4 -echo (string) $ipv6; - -// This will print 1.2.3.4 -echo $ipv6_6to4->toIPv4(); -``` - -### Converting IP ranges - -This library supports IPv4/IPv6 ranges in pattern format (eg. `192.168.*.*`) and in CIDR/subnet format (eg. `192.168.0.0/16`), and it offers a way to convert between the two formats: - -```php -// This will print ::*:*:*:* -echo \IPLib\Factory::parseRangeString('::/64')->asPattern()->toString(); - -// This will print 1:2::/96 -echo \IPLib\Factory::parseRangeString('1:2::*:*')->asSubnet()->toString(); - -// This will print 192.168.0.0/24 -echo \IPLib\Factory::parseRangeString('192.168.0.*')->asSubnet()->toString(); - -// This will print 10.*.*.* -echo \IPLib\Factory::parseRangeString('10.0.0.0/8')->asPattern()->toString(); -``` - -Please remark that all the range types implement the `asPattern()` and `asSubnet()` methods. - -### Getting the subnet mask for IPv4 ranges - -You can use the `getSubnetMask()` to get the subnet mask for IPv4 ranges: - -```php -// This will print 255.255.255.0 -echo \IPLib\Factory::parseRangeString('192.168.0.*')->getSubnetMask()->toString(); - -// This will print 255.255.255.252 -echo \IPLib\Factory::parseRangeString('192.168.0.12/30')->getSubnetMask()->toString(); -``` - -### Getting the range size - -You can use the `getSize()` to get the count of addresses this IP range contains: - -```php -// This will print 256 -echo \IPLib\Factory::parseRangeString('192.168.0.*')->getSize(); - -// This will print 4 -echo \IPLib\Factory::parseRangeString('192.168.0.12/30')->getSize(); - -// This will print 1 -echo \IPLib\Factory::parseRangeString('192.168.0.1')->getSize(); -``` - -### Getting the reverse DNS lookup address - -To perform reverse DNS queries, you need to use a special format of the IP addresses. - -You can use the `getReverseDNSLookupName()` method of the IP address instances to retrieve it easily: - -```php -$ipv4 = \IPLib\Factory::parseAddressString('1.2.3.255'); -$ipv6 = \IPLib\Factory::parseAddressString('1234:abcd::cafe:babe'); - -// This will print 255.3.2.1.in-addr.arpa -echo $ipv4->getReverseDNSLookupName(); - -// This will print e.b.a.b.e.f.a.c.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.d.c.b.a.4.3.2.1.ip6.arpa -echo $ipv6->getReverseDNSLookupName(); -``` - -You can also use `getReverseDNSLookupName()` for IP ranges. -In this case, the result is an array of strings: - -```php -$range = \IPLib\Factory::parseRangeString('10.155.16.0/22'); - -/* - * This will print: - * array ( - * 0 => '16.155.10.in-addr.arpa', - * 1 => '17.155.10.in-addr.arpa', - * 2 => '18.155.10.in-addr.arpa', - * 3 => '19.155.10.in-addr.arpa', - * ) -*/ -var_export($range->getReverseDNSLookupName()); -``` - -### Using a database - -This package offers a great feature: you can store address ranges in a database table, and check if an address is contained in one of the saved ranges with a simple query. - -To save a range, you need to store the address type (for IPv4 it's `4`, for IPv6 it's `6`), as well as two values representing the start and the end of the range. -These methods are: -```php -$range->getAddressType(); -$range->getComparableStartString(); -$range->getComparableEndString(); -``` - -Let's assume that you saved the type in a field called `addressType`, and the range boundaries in two fields called `rangeFrom` and `rangeTo`. - -When you want to check if an address is within a stored range, simply use the `getComparableString` method of the address and check if it's between the fields `rangeFrom` and `rangeTo`, and check if the stored `addressType` is the same as the one of the address instance you want to check. - -Here's a sample code: - -```php -/* - * Let's assume that: - * - $pdo is a PDO instance - * - $range is a range object - * - $address is an address object - */ - -// Save the $range object -$insertQuery = $pdo->prepare(' - insert into ranges (addressType, rangeFrom, rangeTo) - values (:addressType, :rangeFrom, :rangeTo) -'); - -$insertQuery->execute(array( - ':addressType' => $range->getAddressType(), - ':rangeFrom' => $range->getComparableStartString(), - ':rangeTo' => $range->getComparableEndString(), -)); - -// Retrieve the saved ranges where an address $address falls: -$searchQuery = $pdo->prepare(' - select * from ranges - where addressType = :addressType - and :address between rangeFrom and rangeTo -'); - -$searchQuery->execute(array( - ':addressType' => $address->getAddressType(), - ':address' => $address->getComparableString(), -)); - -$rows = $searchQuery->fetchAll(); -$searchQuery->closeCursor(); -``` - -## Handling non-standard address and range strings - -### Accepting ports - -If you want to accept addresses that may include ports, you can specify the `IPLib\ParseStringFlag::MAY_INCLUDE_PORT` flag: - -```php -use IPLib\Factory; -use IPLib\ParseStringFlag; - -require_once __DIR__ . '/../ip-lib.php'; - -// These will print NULL -var_export(Factory::parseAddressString('127.0.0.1:80')); -var_export(Factory::parseAddressString('[::]:80')); - -// This will print 127.0.0.1 -echo (string) Factory::parseAddressString('127.0.0.1:80', ParseStringFlag::MAY_INCLUDE_PORT); -// This will print :: -echo (string) Factory::parseAddressString('[::]:80', ParseStringFlag::MAY_INCLUDE_PORT); -``` - -### Accepting IPv6 zone IDs - -If you want to accept IPv6 addresses that may include a zone ID, you can specify the `IPLib\ParseStringFlag::MAY_INCLUDE_ZONEID` flag: - -```php -use IPLib\Factory; -use IPLib\ParseStringFlag; - -// This will print NULL -var_export(Factory::parseAddressString('::%11')); - -// This will print :: -echo (string) Factory::parseAddressString('::%11', ParseStringFlag::MAY_INCLUDE_ZONEID); -``` - -### Accepting non-decimal IPv4 addresses - -IPv4 addresses are usually expressed in decimal notation, for example as `192.168.0.1`. - -By the way, the GNU (used in many Linux distros), BSD (used in Mac) and Windows implementations of `inet_aton` and `inet_addr` accept IPv4 addresses with numbers in octal and/or hexadecimal format. -Please remark that this does not apply to the `inet_pton` and `ip2long` functions, as well as to the Musl implementation (used in Alpine Linux) of `inet_aton` and `inet_addr`. - -So, for example, these addresses are all equivalent to `192.168.0.1`: - -- `0xC0.0xA8.0x0.0x01` (only hexadecimal) -- `0300.0250.00.01` (only octal) -- `192.0250.0.0x01` (decimal, octal and hexadecimal numbers) - -(try it: if you browse to [`http://0177.0.0.0x1`](http://0177.0.0.0x1), your browser will try to browse `http://127.0.0.1`). - -If you want to accept this non-decimal syntax, you may use the `IPLib\ParseStringFlag::IPV4_MAYBE_NON_DECIMAL` flag: - -```php -use IPLib\Factory; -use IPLib\ParseStringFlag; - -// This will print NULL -var_export(Factory::parseAddressString('0177.0.0.0x1')); - -// This will print 127.0.0.1 -var_export((string) Factory::parseAddressString('0177.0.0.0x1', ParseStringFlag::IPV4_MAYBE_NON_DECIMAL)); - -// This will print NULL -var_export(Factory::parseRangeString('0177.0.0.0x1/32')); - -// This will print 127.0.0.1/32 -var_export((string) Factory::parseRangeString('0177.0.0.0x1/32', ParseStringFlag::IPV4_MAYBE_NON_DECIMAL)); -``` - -Please be aware that the `IPV4_MAYBE_NON_DECIMAL` flag may also affect parsing decimal numbers: - -```php -use IPLib\Factory; -use IPLib\ParseStringFlag; - -// This will print 127.0.0.10 since the last digit is assumed to be decimal -var_export((string) Factory::parseAddressString('127.0.0.010')); - -// This will print 127.0.0.8 since the last digit is assumed to be octal -var_export((string) Factory::parseAddressString('127.0.0.010', ParseStringFlag::IPV4_MAYBE_NON_DECIMAL)); -``` - -### Accepting IPv4 addresses in nod-quad-dotted notation - -IPv4 addresses are usually expressed with 4 numbers, for example as `192.168.0.1`. - -By the way, the GNU (used in many Linux distros), BSD (used in Mac) and Windows implementations of `inet_aton` and `inet_addr` [accept IPv4 addresses with 1 to 4 numbers](https://man7.org/linux/man-pages/man3/inet_addr.3.html#DESCRIPTION). - -Please remark that this does not apply to the `inet_pton` and `ip2long` functions, as well as to the Musl implementation (used in Alpine Linux) of `inet_aton` and `inet_addr`. - -If you want to accept this non-decimal syntax, you may use the `IPLib\ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED` flag: - -```php -use IPLib\Factory; -use IPLib\ParseStringFlag; - -// This will print NULL -var_export(Factory::parseAddressString('1.2.500')); - -// This will print 0.0.0.0 -var_export((string) Factory::parseAddressString('0', ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED)); - -// This will print 0.0.0.1 -var_export((string) Factory::parseAddressString('1', ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED)); - -// This will print 0.0.1.244 -var_export((string) Factory::parseAddressString('0.0.500', ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED)); - -// This will print 255.255.255.255 -var_export((string) Factory::parseAddressString('4294967295', ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED)); -``` - -### Accepting compact IPv4 subnet notation - -Even if there isn't an RFC that describe it, IPv4 subnet notation may also be written in a compact form, omitting extra digits (for example, `127.0.0.0/24` may be written as `127/24`). -If you want to accept such format, you can specify the `IPLib\ParseStringFlag::IPV4SUBNET_MAYBE_COMPACT` flag: - -```php -use IPLib\Factory; -use IPLib\ParseStringFlag; - -// This will print NULL -var_export(Factory::parseRangeString('127/24')); - -// This will print 127.0.0.0/24 -echo (string) Factory::parseRangeString('127/24', ParseStringFlag::IPV4SUBNET_MAYBE_COMPACT); -``` - -### Combining multiple flags - -Of course, you may use more than one `IPLib\ParseStringFlag` flag at once: - -```php -use IPLib\Factory; -use IPLib\ParseStringFlag; - -// This will print 127.0.0.255 -var_export((string) Factory::parseAddressString('127.0.0.0xff:80', ParseStringFlag::MAY_INCLUDE_PORT | ParseStringFlag::IPV4_MAYBE_NON_DECIMAL)); - -// This will print :: -var_export((string) Factory::parseAddressString('[::%11]:80', ParseStringFlag::MAY_INCLUDE_PORT | ParseStringFlag::MAY_INCLUDE_ZONEID)); -``` - -## Do you really want to say thank you? - -You can offer me a [monthly coffee](https://github.com/sponsors/mlocati) or a [one-time coffee](https://paypal.me/mlocati) :wink: diff --git a/app/vendor/mlocati/ip-lib/composer.json b/app/vendor/mlocati/ip-lib/composer.json deleted file mode 100644 index bb11be4..0000000 --- a/app/vendor/mlocati/ip-lib/composer.json +++ /dev/null @@ -1,60 +0,0 @@ -{ - "name": "mlocati/ip-lib", - "description": "Handle IPv4, IPv6 addresses and ranges", - "type": "library", - "license": "MIT", - "homepage": "https://github.com/mlocati/ip-lib", - "authors": [ - { - "name": "Michele Locati", - "homepage": "https://github.com/mlocati", - "email": "mlocati@gmail.com", - "role": "Author" - } - ], - "keywords": [ - "ip", - "ipv4", - "ipv6", - "range", - "network", - "networking", - "address", - "addresses", - "subnet", - "matching", - "managing", - "manage" - ], - "require": { - "php": ">=5.3.3" - }, - "autoload": { - "psr-4": { - "IPLib\\": "src/" - } - }, - "autoload-dev": { - "psr-4": { - "IPLib\\Test\\": "test/tests/", - "IPLib\\Test\\Helpers\\": "test/helpers/" - } - }, - "require-dev": { - "ext-pdo_sqlite": "*", - "phpunit/phpunit": "^4.8 || ^5.7 || ^6.5 || ^7.5 || ^8.5 || ^9.5" - }, - "scripts": { - "test": "phpunit" - }, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/mlocati" - }, - { - "type": "other", - "url": "https://paypal.me/mlocati" - } - ] -} diff --git a/app/vendor/mlocati/ip-lib/ip-lib.php b/app/vendor/mlocati/ip-lib/ip-lib.php deleted file mode 100644 index c34d0b4..0000000 --- a/app/vendor/mlocati/ip-lib/ip-lib.php +++ /dev/null @@ -1,13 +0,0 @@ -range = $range; - $this->type = $type; - $this->exceptions = $exceptions; - } - - /** - * Get the range definition. - * - * @return \IPLib\Range\RangeInterface - */ - public function getRange() - { - return $this->range; - } - - /** - * Get the range type. - * - * @return int one of the \IPLib\Range\Type::T_ constants - */ - public function getType() - { - return $this->type; - } - - /** - * Get the list of exceptions for this range type. - * - * @return \IPLib\Address\AssignedRange[] - */ - public function getExceptions() - { - return $this->exceptions; - } - - /** - * Get the assigned type for a specific address. - * - * @param \IPLib\Address\AddressInterface $address - * - * @return int|null return NULL of the address is outside this address; a \IPLib\Range\Type::T_ constant otherwise - */ - public function getAddressType(AddressInterface $address) - { - $result = null; - if ($this->range->contains($address)) { - foreach ($this->exceptions as $exception) { - $result = $exception->getAddressType($address); - if ($result !== null) { - break; - } - } - if ($result === null) { - $result = $this->type; - } - } - - return $result; - } - - /** - * Get the assigned type for a specific address range. - * - * @param \IPLib\Range\RangeInterface $range - * - * @return int|false|null return NULL of the range is fully outside this range; false if it's partly crosses this range (or it contains mixed types); a \IPLib\Range\Type::T_ constant otherwise - */ - public function getRangeType(RangeInterface $range) - { - $myStart = $this->range->getComparableStartString(); - $rangeEnd = $range->getComparableEndString(); - if ($myStart > $rangeEnd) { - $result = null; - } else { - $myEnd = $this->range->getComparableEndString(); - $rangeStart = $range->getComparableStartString(); - if ($myEnd < $rangeStart) { - $result = null; - } elseif ($rangeStart < $myStart || $rangeEnd > $myEnd) { - $result = false; - } else { - $result = null; - foreach ($this->exceptions as $exception) { - $result = $exception->getRangeType($range); - if ($result !== null) { - break; - } - } - if ($result === null) { - $result = $this->getType(); - } - } - } - - return $result; - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Address/IPv4.php b/app/vendor/mlocati/ip-lib/src/Address/IPv4.php deleted file mode 100644 index f2fe3fb..0000000 --- a/app/vendor/mlocati/ip-lib/src/Address/IPv4.php +++ /dev/null @@ -1,509 +0,0 @@ -address = $address; - $this->bytes = null; - $this->rangeType = null; - $this->comparableString = null; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::__toString() - */ - public function __toString() - { - return $this->address; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getNumberOfBits() - */ - public static function getNumberOfBits() - { - return 32; - } - - /** - * @deprecated since 1.17.0: use the parseString() method instead. - * For upgrading: - * - if $mayIncludePort is true, use the ParseStringFlag::MAY_INCLUDE_PORT flag - * - if $supportNonDecimalIPv4 is true, use the ParseStringFlag::IPV4_MAYBE_NON_DECIMAL flag - * - * @param string|mixed $address the address to parse - * @param bool $mayIncludePort - * @param bool $supportNonDecimalIPv4 - * - * @return static|null - * - * @see \IPLib\Address\IPv4::parseString() - * @since 1.1.0 added the $mayIncludePort argument - * @since 1.10.0 added the $supportNonDecimalIPv4 argument - */ - public static function fromString($address, $mayIncludePort = true, $supportNonDecimalIPv4 = false) - { - return static::parseString($address, 0 | ($mayIncludePort ? ParseStringFlag::MAY_INCLUDE_PORT : 0) | ($supportNonDecimalIPv4 ? ParseStringFlag::IPV4_MAYBE_NON_DECIMAL : 0)); - } - - /** - * Parse a string and returns an IPv4 instance if the string is valid, or null otherwise. - * - * @param string|mixed $address the address to parse - * @param int $flags A combination or zero or more flags - * - * @return static|null - * - * @see \IPLib\ParseStringFlag - * @since 1.17.0 - */ - public static function parseString($address, $flags = 0) - { - if (!is_string($address)) { - return null; - } - $flags = (int) $flags; - if ($flags & ParseStringFlag::IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED) { - if (strpos($address, '.') === 0) { - return null; - } - $lengthNonHex = '{1,11}'; - $lengthHex = '{1,8}'; - $chunk234Optional = true; - } else { - if (!strpos($address, '.')) { - return null; - } - $lengthNonHex = '{1,3}'; - $lengthHex = '{1,2}'; - $chunk234Optional = false; - } - $rxChunk1 = "0?[0-9]{$lengthNonHex}"; - if ($flags & ParseStringFlag::IPV4_MAYBE_NON_DECIMAL) { - $rxChunk1 = "(?:0[Xx]0*[0-9A-Fa-f]{$lengthHex})|(?:{$rxChunk1})"; - $onlyDecimal = false; - } else { - $onlyDecimal = true; - } - $rxChunk1 = "0*?({$rxChunk1})"; - $rxChunk234 = "\.{$rxChunk1}"; - if ($chunk234Optional) { - $rxChunk234 = "(?:{$rxChunk234})?"; - } - $rx = "{$rxChunk1}{$rxChunk234}{$rxChunk234}{$rxChunk234}"; - if ($flags & ParseStringFlag::MAY_INCLUDE_PORT) { - $rx .= '(?::\d+)?'; - } - $matches = null; - if (!preg_match('/^' . $rx . '$/', $address, $matches)) { - return null; - } - $math = new \IPLib\Service\UnsignedIntegerMath(); - $nums = array(); - $maxChunkIndex = count($matches) - 1; - for ($i = 1; $i <= $maxChunkIndex; $i++) { - $numBytes = $i === $maxChunkIndex ? 5 - $i : 1; - $chunkBytes = $math->getBytes($matches[$i], $numBytes, $onlyDecimal); - if ($chunkBytes === null) { - return null; - } - $nums = array_merge($nums, $chunkBytes); - } - - return new static(implode('.', $nums)); - } - - /** - * Parse an array of bytes and returns an IPv4 instance if the array is valid, or null otherwise. - * - * @param int[]|array $bytes - * - * @return static|null - */ - public static function fromBytes(array $bytes) - { - $result = null; - if (count($bytes) === 4) { - $chunks = array_map( - function ($byte) { - return (is_int($byte) && $byte >= 0 && $byte <= 255) ? (string) $byte : false; - }, - $bytes - ); - if (in_array(false, $chunks, true) === false) { - $result = new static(implode('.', $chunks)); - } - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::toString() - */ - public function toString($long = false) - { - if ($long) { - return $this->getComparableString(); - } - - return $this->address; - } - - /** - * Get the octal representation of this IP address. - * - * @param bool $long - * - * @return string - * - * @since 1.10.0 - * - * @example if $long == false: if the decimal representation is '0.7.8.255': '0.7.010.0377' - * @example if $long == true: if the decimal representation is '0.7.8.255': '0000.0007.0010.0377' - */ - public function toOctal($long = false) - { - $chunks = array(); - foreach ($this->getBytes() as $byte) { - if ($long) { - $chunks[] = sprintf('%04o', $byte); - } else { - $chunks[] = '0' . decoct($byte); - } - } - - return implode('.', $chunks); - } - - /** - * Get the hexadecimal representation of this IP address. - * - * @param bool $long - * - * @return string - * - * @since 1.10.0 - * - * @example if $long == false: if the decimal representation is '0.9.10.255': '0.9.0xa.0xff' - * @example if $long == true: if the decimal representation is '0.9.10.255': '0x00.0x09.0x0a.0xff' - */ - public function toHexadecimal($long = false) - { - $chunks = array(); - foreach ($this->getBytes() as $byte) { - if ($long) { - $chunks[] = sprintf('0x%02x', $byte); - } else { - $chunks[] = '0x' . dechex($byte); - } - } - - return implode('.', $chunks); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getBytes() - */ - public function getBytes() - { - if ($this->bytes === null) { - $this->bytes = array_map( - function ($chunk) { - return (int) $chunk; - }, - explode('.', $this->address) - ); - } - - return $this->bytes; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getBits() - */ - public function getBits() - { - $parts = array(); - foreach ($this->getBytes() as $byte) { - $parts[] = sprintf('%08b', $byte); - } - - return implode('', $parts); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getAddressType() - */ - public function getAddressType() - { - return Type::T_IPv4; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getDefaultReservedRangeType() - */ - public static function getDefaultReservedRangeType() - { - return RangeType::T_PUBLIC; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getReservedRanges() - */ - public static function getReservedRanges() - { - if (self::$reservedRanges === null) { - $reservedRanges = array(); - foreach (array( - // RFC 5735 - '0.0.0.0/8' => array(RangeType::T_THISNETWORK, array('0.0.0.0/32' => RangeType::T_UNSPECIFIED)), - // RFC 5735 - '10.0.0.0/8' => array(RangeType::T_PRIVATENETWORK), - // RFC 6598 - '100.64.0.0/10' => array(RangeType::T_CGNAT), - // RFC 5735 - '127.0.0.0/8' => array(RangeType::T_LOOPBACK), - // RFC 5735 - '169.254.0.0/16' => array(RangeType::T_LINKLOCAL), - // RFC 5735 - '172.16.0.0/12' => array(RangeType::T_PRIVATENETWORK), - // RFC 5735 - '192.0.0.0/24' => array(RangeType::T_RESERVED), - // RFC 5735 - '192.0.2.0/24' => array(RangeType::T_RESERVED), - // RFC 5735 - '192.88.99.0/24' => array(RangeType::T_ANYCASTRELAY), - // RFC 5735 - '192.168.0.0/16' => array(RangeType::T_PRIVATENETWORK), - // RFC 5735 - '198.18.0.0/15' => array(RangeType::T_RESERVED), - // RFC 5735 - '198.51.100.0/24' => array(RangeType::T_RESERVED), - // RFC 5735 - '203.0.113.0/24' => array(RangeType::T_RESERVED), - // RFC 5735 - '224.0.0.0/4' => array(RangeType::T_MULTICAST), - // RFC 5735 - '240.0.0.0/4' => array(RangeType::T_RESERVED, array('255.255.255.255/32' => RangeType::T_LIMITEDBROADCAST)), - ) as $range => $data) { - $exceptions = array(); - if (isset($data[1])) { - foreach ($data[1] as $exceptionRange => $exceptionType) { - $exceptions[] = new AssignedRange(Subnet::parseString($exceptionRange), $exceptionType); - } - } - $reservedRanges[] = new AssignedRange(Subnet::parseString($range), $data[0], $exceptions); - } - self::$reservedRanges = $reservedRanges; - } - - return self::$reservedRanges; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getRangeType() - */ - public function getRangeType() - { - if ($this->rangeType === null) { - $rangeType = null; - foreach (static::getReservedRanges() as $reservedRange) { - $rangeType = $reservedRange->getAddressType($this); - if ($rangeType !== null) { - break; - } - } - $this->rangeType = $rangeType === null ? static::getDefaultReservedRangeType() : $rangeType; - } - - return $this->rangeType; - } - - /** - * Create an IPv6 representation of this address (in 6to4 notation). - * - * @return \IPLib\Address\IPv6 - */ - public function toIPv6() - { - $myBytes = $this->getBytes(); - - return IPv6::parseString('2002:' . sprintf('%02x', $myBytes[0]) . sprintf('%02x', $myBytes[1]) . ':' . sprintf('%02x', $myBytes[2]) . sprintf('%02x', $myBytes[3]) . '::'); - } - - /** - * Create an IPv6 representation of this address (in IPv6 IPv4-mapped notation). - * - * @return \IPLib\Address\IPv6 - * - * @since 1.11.0 - */ - public function toIPv6IPv4Mapped() - { - return IPv6::fromBytes(array_merge(array(0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff), $this->getBytes())); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getComparableString() - */ - public function getComparableString() - { - if ($this->comparableString === null) { - $chunks = array(); - foreach ($this->getBytes() as $byte) { - $chunks[] = sprintf('%03d', $byte); - } - $this->comparableString = implode('.', $chunks); - } - - return $this->comparableString; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::matches() - */ - public function matches(RangeInterface $range) - { - return $range->contains($this); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getAddressAtOffset() - */ - public function getAddressAtOffset($n) - { - if (!is_int($n)) { - return null; - } - - $boundary = 256; - $mod = $n; - $bytes = $this->getBytes(); - for ($i = count($bytes) - 1; $i >= 0; $i--) { - $tmp = ($bytes[$i] + $mod) % $boundary; - $mod = (int) floor(($bytes[$i] + $mod) / $boundary); - if ($tmp < 0) { - $tmp += $boundary; - } - - $bytes[$i] = $tmp; - } - - if ($mod !== 0) { - return null; - } - - return static::fromBytes($bytes); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getNextAddress() - */ - public function getNextAddress() - { - return $this->getAddressAtOffset(1); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getPreviousAddress() - */ - public function getPreviousAddress() - { - return $this->getAddressAtOffset(-1); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getReverseDNSLookupName() - */ - public function getReverseDNSLookupName() - { - return implode( - '.', - array_reverse($this->getBytes()) - ) . '.in-addr.arpa'; - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Address/IPv6.php b/app/vendor/mlocati/ip-lib/src/Address/IPv6.php deleted file mode 100644 index 6f92197..0000000 --- a/app/vendor/mlocati/ip-lib/src/Address/IPv6.php +++ /dev/null @@ -1,595 +0,0 @@ -longAddress = $longAddress; - $this->shortAddress = null; - $this->bytes = null; - $this->words = null; - $this->rangeType = null; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::__toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getNumberOfBits() - */ - public static function getNumberOfBits() - { - return 128; - } - - /** - * @deprecated since 1.17.0: use the parseString() method instead. - * For upgrading: - * - if $mayIncludePort is true, use the ParseStringFlag::MAY_INCLUDE_PORT flag - * - if $mayIncludeZoneID is true, use the ParseStringFlag::MAY_INCLUDE_ZONEID flag - * - * @param string|mixed $address - * @param bool $mayIncludePort - * @param bool $mayIncludeZoneID - * - * @return static|null - * - * @see \IPLib\Address\IPv6::parseString() - * @since 1.1.0 added the $mayIncludePort argument - * @since 1.3.0 added the $mayIncludeZoneID argument - */ - public static function fromString($address, $mayIncludePort = true, $mayIncludeZoneID = true) - { - return static::parseString($address, 0 | ($mayIncludePort ? ParseStringFlag::MAY_INCLUDE_PORT : 0) | ($mayIncludeZoneID ? ParseStringFlag::MAY_INCLUDE_ZONEID : 0)); - } - - /** - * Parse a string and returns an IPv6 instance if the string is valid, or null otherwise. - * - * @param string|mixed $address the address to parse - * @param int $flags A combination or zero or more flags - * - * @return static|null - * - * @see \IPLib\ParseStringFlag - * @since 1.17.0 - */ - public static function parseString($address, $flags = 0) - { - $flags = (int) $flags; - $result = null; - if (is_string($address) && strpos($address, ':') !== false && strpos($address, ':::') === false) { - $matches = null; - if ($flags & ParseStringFlag::MAY_INCLUDE_PORT && $address[0] === '[' && preg_match('/^\[(.+)]:\d+$/', $address, $matches)) { - $address = $matches[1]; - } - if ($flags & ParseStringFlag::MAY_INCLUDE_ZONEID) { - $percentagePos = strpos($address, '%'); - if ($percentagePos > 0) { - $address = substr($address, 0, $percentagePos); - } - } - if (preg_match('/^((?:[0-9a-f]*:+)+)(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})$/i', $address, $matches)) { - $address6 = static::parseString($matches[1] . '0:0'); - if ($address6 !== null) { - $address4 = IPv4::parseString($matches[2]); - if ($address4 !== null) { - $bytes4 = $address4->getBytes(); - $address6->longAddress = substr($address6->longAddress, 0, -9) . sprintf('%02x%02x:%02x%02x', $bytes4[0], $bytes4[1], $bytes4[2], $bytes4[3]); - $result = $address6; - } - } - } else { - if (strpos($address, '::') === false) { - $chunks = explode(':', $address); - } else { - $chunks = array(); - $parts = explode('::', $address); - if (count($parts) === 2) { - $before = ($parts[0] === '') ? array() : explode(':', $parts[0]); - $after = ($parts[1] === '') ? array() : explode(':', $parts[1]); - $missing = 8 - count($before) - count($after); - if ($missing >= 0) { - $chunks = $before; - if ($missing !== 0) { - $chunks = array_merge($chunks, array_fill(0, $missing, '0')); - } - $chunks = array_merge($chunks, $after); - } - } - } - if (count($chunks) === 8) { - $nums = array_map( - function ($chunk) { - return preg_match('/^[0-9A-Fa-f]{1,4}$/', $chunk) ? hexdec($chunk) : false; - }, - $chunks - ); - if (!in_array(false, $nums, true)) { - $longAddress = implode( - ':', - array_map( - function ($num) { - return sprintf('%04x', $num); - }, - $nums - ) - ); - $result = new static($longAddress); - } - } - } - } - - return $result; - } - - /** - * Parse an array of bytes and returns an IPv6 instance if the array is valid, or null otherwise. - * - * @param int[]|array $bytes - * - * @return static|null - */ - public static function fromBytes(array $bytes) - { - $result = null; - if (count($bytes) === 16) { - $address = ''; - for ($i = 0; $i < 16; $i++) { - if ($i !== 0 && $i % 2 === 0) { - $address .= ':'; - } - $byte = $bytes[$i]; - if (is_int($byte) && $byte >= 0 && $byte <= 255) { - $address .= sprintf('%02x', $byte); - } else { - $address = null; - break; - } - } - if ($address !== null) { - $result = new static($address); - } - } - - return $result; - } - - /** - * Parse an array of words and returns an IPv6 instance if the array is valid, or null otherwise. - * - * @param int[]|array $words - * - * @return static|null - */ - public static function fromWords(array $words) - { - $result = null; - if (count($words) === 8) { - $chunks = array(); - for ($i = 0; $i < 8; $i++) { - $word = $words[$i]; - if (is_int($word) && $word >= 0 && $word <= 0xffff) { - $chunks[] = sprintf('%04x', $word); - } else { - $chunks = null; - break; - } - } - if ($chunks !== null) { - $result = new static(implode(':', $chunks)); - } - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::toString() - */ - public function toString($long = false) - { - if ($long) { - $result = $this->longAddress; - } else { - if ($this->shortAddress === null) { - if (strpos($this->longAddress, '0000:0000:0000:0000:0000:ffff:') === 0) { - $lastBytes = array_slice($this->getBytes(), -4); - $this->shortAddress = '::ffff:' . implode('.', $lastBytes); - } else { - $chunks = array_map( - function ($word) { - return dechex($word); - }, - $this->getWords() - ); - $shortAddress = implode(':', $chunks); - $matches = null; - for ($i = 8; $i > 1; $i--) { - $search = '(?:^|:)' . rtrim(str_repeat('0:', $i), ':') . '(?:$|:)'; - if (preg_match('/^(.*?)' . $search . '(.*)$/', $shortAddress, $matches)) { - $shortAddress = $matches[1] . '::' . $matches[2]; - break; - } - } - $this->shortAddress = $shortAddress; - } - } - $result = $this->shortAddress; - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getBytes() - */ - public function getBytes() - { - if ($this->bytes === null) { - $bytes = array(); - foreach ($this->getWords() as $word) { - $bytes[] = $word >> 8; - $bytes[] = $word & 0xff; - } - $this->bytes = $bytes; - } - - return $this->bytes; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getBits() - */ - public function getBits() - { - $parts = array(); - foreach ($this->getBytes() as $byte) { - $parts[] = sprintf('%08b', $byte); - } - - return implode('', $parts); - } - - /** - * Get the word list of the IP address. - * - * @return int[] - */ - public function getWords() - { - if ($this->words === null) { - $this->words = array_map( - function ($chunk) { - return hexdec($chunk); - }, - explode(':', $this->longAddress) - ); - } - - return $this->words; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getAddressType() - */ - public function getAddressType() - { - return Type::T_IPv6; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getDefaultReservedRangeType() - */ - public static function getDefaultReservedRangeType() - { - return RangeType::T_RESERVED; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getReservedRanges() - */ - public static function getReservedRanges() - { - if (self::$reservedRanges === null) { - $reservedRanges = array(); - foreach (array( - // RFC 4291 - '::/128' => array(RangeType::T_UNSPECIFIED), - // RFC 4291 - '::1/128' => array(RangeType::T_LOOPBACK), - // RFC 4291 - '100::/8' => array(RangeType::T_DISCARD, array('100::/64' => RangeType::T_DISCARDONLY)), - //'2002::/16' => array(RangeType::), - // RFC 4291 - '2000::/3' => array(RangeType::T_PUBLIC), - // RFC 4193 - 'fc00::/7' => array(RangeType::T_PRIVATENETWORK), - // RFC 4291 - 'fe80::/10' => array(RangeType::T_LINKLOCAL_UNICAST), - // RFC 4291 - 'ff00::/8' => array(RangeType::T_MULTICAST), - // RFC 4291 - //'::/8' => array(RangeType::T_RESERVED), - // RFC 4048 - //'200::/7' => array(RangeType::T_RESERVED), - // RFC 4291 - //'400::/6' => array(RangeType::T_RESERVED), - // RFC 4291 - //'800::/5' => array(RangeType::T_RESERVED), - // RFC 4291 - //'1000::/4' => array(RangeType::T_RESERVED), - // RFC 4291 - //'4000::/3' => array(RangeType::T_RESERVED), - // RFC 4291 - //'6000::/3' => array(RangeType::T_RESERVED), - // RFC 4291 - //'8000::/3' => array(RangeType::T_RESERVED), - // RFC 4291 - //'a000::/3' => array(RangeType::T_RESERVED), - // RFC 4291 - //'c000::/3' => array(RangeType::T_RESERVED), - // RFC 4291 - //'e000::/4' => array(RangeType::T_RESERVED), - // RFC 4291 - //'f000::/5' => array(RangeType::T_RESERVED), - // RFC 4291 - //'f800::/6' => array(RangeType::T_RESERVED), - // RFC 4291 - //'fe00::/9' => array(RangeType::T_RESERVED), - // RFC 3879 - //'fec0::/10' => array(RangeType::T_RESERVED), - ) as $range => $data) { - $exceptions = array(); - if (isset($data[1])) { - foreach ($data[1] as $exceptionRange => $exceptionType) { - $exceptions[] = new AssignedRange(Subnet::parseString($exceptionRange), $exceptionType); - } - } - $reservedRanges[] = new AssignedRange(Subnet::parseString($range), $data[0], $exceptions); - } - self::$reservedRanges = $reservedRanges; - } - - return self::$reservedRanges; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getRangeType() - */ - public function getRangeType() - { - if ($this->rangeType === null) { - $ipv4 = $this->toIPv4(); - if ($ipv4 !== null) { - $this->rangeType = $ipv4->getRangeType(); - } else { - $rangeType = null; - foreach (static::getReservedRanges() as $reservedRange) { - $rangeType = $reservedRange->getAddressType($this); - if ($rangeType !== null) { - break; - } - } - $this->rangeType = $rangeType === null ? static::getDefaultReservedRangeType() : $rangeType; - } - } - - return $this->rangeType; - } - - /** - * Create an IPv4 representation of this address (if possible, otherwise returns null). - * - * @return \IPLib\Address\IPv4|null - */ - public function toIPv4() - { - if (strpos($this->longAddress, '2002:') === 0) { - // 6to4 - return IPv4::fromBytes(array_slice($this->getBytes(), 2, 4)); - } - if (strpos($this->longAddress, '0000:0000:0000:0000:0000:ffff:') === 0) { - // IPv4-mapped IPv6 addresses - return IPv4::fromBytes(array_slice($this->getBytes(), -4)); - } - - return null; - } - - /** - * Render this IPv6 address in the "mixed" IPv6 (first 12 bytes) + IPv4 (last 4 bytes) mixed syntax. - * - * @param bool $ipV6Long render the IPv6 part in "long" format? - * @param bool $ipV4Long render the IPv4 part in "long" format? - * - * @return string - * - * @example '::13.1.68.3' - * @example '0000:0000:0000:0000:0000:0000:13.1.68.3' when $ipV6Long is true - * @example '::013.001.068.003' when $ipV4Long is true - * @example '0000:0000:0000:0000:0000:0000:013.001.068.003' when $ipV6Long and $ipV4Long are true - * - * @see https://tools.ietf.org/html/rfc4291#section-2.2 point 3. - * @since 1.9.0 - */ - public function toMixedIPv6IPv4String($ipV6Long = false, $ipV4Long = false) - { - $myBytes = $this->getBytes(); - $ipv6Bytes = array_merge(array_slice($myBytes, 0, 12), array(0xff, 0xff, 0xff, 0xff)); - $ipv6String = static::fromBytes($ipv6Bytes)->toString($ipV6Long); - $ipv4Bytes = array_slice($myBytes, 12, 4); - $ipv4String = IPv4::fromBytes($ipv4Bytes)->toString($ipV4Long); - - return preg_replace('/((ffff:ffff)|(\d+(\.\d+){3}))$/i', $ipv4String, $ipv6String); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getComparableString() - */ - public function getComparableString() - { - return $this->longAddress; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::matches() - */ - public function matches(RangeInterface $range) - { - return $range->contains($this); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getAddressAtOffset() - */ - public function getAddressAtOffset($n) - { - if (!is_int($n)) { - return null; - } - - $boundary = 0x10000; - $mod = $n; - $words = $this->getWords(); - for ($i = count($words) - 1; $i >= 0; $i--) { - $tmp = ($words[$i] + $mod) % $boundary; - $mod = (int) floor(($words[$i] + $mod) / $boundary); - if ($tmp < 0) { - $tmp += $boundary; - } - - $words[$i] = $tmp; - } - - if ($mod !== 0) { - return null; - } - - return static::fromWords($words); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getNextAddress() - */ - public function getNextAddress() - { - return $this->getAddressAtOffset(1); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getPreviousAddress() - */ - public function getPreviousAddress() - { - return $this->getAddressAtOffset(-1); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Address\AddressInterface::getReverseDNSLookupName() - */ - public function getReverseDNSLookupName() - { - return implode( - '.', - array_reverse(str_split(str_replace(':', '', $this->toString(true)), 1)) - ) . '.ip6.arpa'; - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Address/Type.php b/app/vendor/mlocati/ip-lib/src/Address/Type.php deleted file mode 100644 index 17488f3..0000000 --- a/app/vendor/mlocati/ip-lib/src/Address/Type.php +++ /dev/null @@ -1,44 +0,0 @@ -getNumberOfBits())); - } - $numberOfBits = $from->getNumberOfBits(); - if ($to->getNumberOfBits() !== $numberOfBits) { - return null; - } - $calculator = new RangesFromBoundaryCalculator($numberOfBits); - - return $calculator->getRanges($from, $to); - } - - /** - * @param \IPLib\Address\AddressInterface $from - * @param \IPLib\Address\AddressInterface $to - * - * @return \IPLib\Range\RangeInterface|null - * - * @since 1.2.0 - */ - protected static function rangeFromBoundaryAddresses(AddressInterface $from = null, AddressInterface $to = null) - { - if ($from === null && $to === null) { - $result = null; - } elseif ($to === null) { - $result = Range\Single::fromAddress($from); - } elseif ($from === null) { - $result = Range\Single::fromAddress($to); - } else { - $result = null; - $addressType = $from->getAddressType(); - if ($addressType === $to->getAddressType()) { - $cmp = strcmp($from->getComparableString(), $to->getComparableString()); - if ($cmp === 0) { - $result = Range\Single::fromAddress($from); - } else { - if ($cmp > 0) { - list($from, $to) = array($to, $from); - } - $fromBytes = $from->getBytes(); - $toBytes = $to->getBytes(); - $numBytes = count($fromBytes); - $sameBits = 0; - for ($byteIndex = 0; $byteIndex < $numBytes; $byteIndex++) { - $fromByte = $fromBytes[$byteIndex]; - $toByte = $toBytes[$byteIndex]; - if ($fromByte === $toByte) { - $sameBits += 8; - } else { - $differentBitsInByte = decbin($fromByte ^ $toByte); - $sameBits += 8 - strlen($differentBitsInByte); - break; - } - } - $result = static::parseRangeString($from->toString() . '/' . (string) $sameBits); - } - } - } - - return $result; - } - - /** - * @param string|\IPLib\Address\AddressInterface $from - * @param string|\IPLib\Address\AddressInterface $to - * @param int $flags - * - * @return \IPLib\Address\AddressInterface[]|null[]|false[] - */ - private static function parseBoundaries($from, $to, $flags = 0) - { - $result = array(); - foreach (array('from', 'to') as $param) { - $value = $$param; - if (!($value instanceof AddressInterface)) { - $value = (string) $value; - if ($value === '') { - $value = null; - } else { - $value = static::parseAddressString($value, $flags); - if ($value === null) { - $value = false; - } - } - } - $result[] = $value; - } - if ($result[0] && $result[1] && strcmp($result[0]->getComparableString(), $result[1]->getComparableString()) > 0) { - $result = array($result[1], $result[0]); - } - - return $result; - } -} diff --git a/app/vendor/mlocati/ip-lib/src/ParseStringFlag.php b/app/vendor/mlocati/ip-lib/src/ParseStringFlag.php deleted file mode 100644 index 4be38d5..0000000 --- a/app/vendor/mlocati/ip-lib/src/ParseStringFlag.php +++ /dev/null @@ -1,67 +0,0 @@ - 5.0.0.1 - * @example 5.256 => 5.0.1.0 - * @example 5.0.256 => 5.0.1.0 - * @example 123456789 => 7.91.205.21 - */ - const IPV4_MAYBE_NON_DECIMAL = 4; - - /** - * Use this flag if IPv4 subnet ranges may be in compact form. - * - * @example 127/24 => 127.0.0.0/24 - * @example 10/8 => 10.0.0.0/8 - * @example 10/24 => 10.0.0.0/24 - * @example 10.10.10/24 => 10.10.10.0/24 - * - * @var int - */ - const IPV4SUBNET_MAYBE_COMPACT = 8; - - /** - * Use this flag if IPv4 addresses may be in non quad-dotted notation. - * This notation is accepted by the implementation of inet_aton and inet_addr of the libc implementation of GNU, Windows and Mac (but not Musl), but not by inet_pton and ip2long. - * - * @var int - * - * @example 5.1 => 5.0.0.1 - * @example 5.256 => 5.0.1.0 - * @example 5.0.256 => 5.0.1.0 - * @example 123456789 => 7.91.205.21 - * - * @see https://man7.org/linux/man-pages/man3/inet_addr.3.html#DESCRIPTION - * @see https://www.freebsd.org/cgi/man.cgi?query=inet_net&sektion=3&apropos=0&manpath=FreeBSD+12.2-RELEASE+and+Ports#end - * @see http://git.musl-libc.org/cgit/musl/tree/src/network/inet_aton.c?h=v1.2.2 - */ - const IPV4ADDRESS_MAYBE_NON_QUAD_DOTTED = 16; -} diff --git a/app/vendor/mlocati/ip-lib/src/Range/AbstractRange.php b/app/vendor/mlocati/ip-lib/src/Range/AbstractRange.php deleted file mode 100644 index 1220435..0000000 --- a/app/vendor/mlocati/ip-lib/src/Range/AbstractRange.php +++ /dev/null @@ -1,125 +0,0 @@ -rangeType === null) { - $addressType = $this->getAddressType(); - if ($addressType === AddressType::T_IPv6 && Subnet::get6to4()->containsRange($this)) { - $this->rangeType = Factory::getRangeFromBoundaries($this->fromAddress->toIPv4(), $this->toAddress->toIPv4())->getRangeType(); - } else { - switch ($addressType) { - case AddressType::T_IPv4: - $defaultType = IPv4::getDefaultReservedRangeType(); - $reservedRanges = IPv4::getReservedRanges(); - break; - case AddressType::T_IPv6: - $defaultType = IPv6::getDefaultReservedRangeType(); - $reservedRanges = IPv6::getReservedRanges(); - break; - default: - throw new \Exception('@todo'); // @codeCoverageIgnore - } - $rangeType = null; - foreach ($reservedRanges as $reservedRange) { - $rangeType = $reservedRange->getRangeType($this); - if ($rangeType !== null) { - break; - } - } - $this->rangeType = $rangeType === null ? $defaultType : $rangeType; - } - } - - return $this->rangeType === false ? null : $this->rangeType; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getAddressAtOffset() - */ - public function getAddressAtOffset($n) - { - if (!is_int($n)) { - return null; - } - - $address = null; - if ($n >= 0) { - $start = Factory::parseAddressString($this->getComparableStartString()); - $address = $start->getAddressAtOffset($n); - } else { - $end = Factory::parseAddressString($this->getComparableEndString()); - $address = $end->getAddressAtOffset($n + 1); - } - - if ($address === null) { - return null; - } - - return $this->contains($address) ? $address : null; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::contains() - */ - public function contains(AddressInterface $address) - { - $result = false; - if ($address->getAddressType() === $this->getAddressType()) { - $cmp = $address->getComparableString(); - $from = $this->getComparableStartString(); - if ($cmp >= $from) { - $to = $this->getComparableEndString(); - if ($cmp <= $to) { - $result = true; - } - } - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::containsRange() - */ - public function containsRange(RangeInterface $range) - { - $result = false; - if ($range->getAddressType() === $this->getAddressType()) { - $myStart = $this->getComparableStartString(); - $itsStart = $range->getComparableStartString(); - if ($itsStart >= $myStart) { - $myEnd = $this->getComparableEndString(); - $itsEnd = $range->getComparableEndString(); - if ($itsEnd <= $myEnd) { - $result = true; - } - } - } - - return $result; - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Range/Pattern.php b/app/vendor/mlocati/ip-lib/src/Range/Pattern.php deleted file mode 100644 index 1e180ea..0000000 --- a/app/vendor/mlocati/ip-lib/src/Range/Pattern.php +++ /dev/null @@ -1,322 +0,0 @@ -fromAddress = $fromAddress; - $this->toAddress = $toAddress; - $this->asterisksCount = $asterisksCount; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::__toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** - * @deprecated since 1.17.0: use the parseString() method instead. - * For upgrading: - * - if $supportNonDecimalIPv4 is true, use the ParseStringFlag::IPV4_MAYBE_NON_DECIMAL flag - * - * @param string|mixed $range - * @param bool $supportNonDecimalIPv4 - * - * @return static|null - * - * @see \IPLib\Range\Pattern::parseString() - * @since 1.10.0 added the $supportNonDecimalIPv4 argument - */ - public static function fromString($range, $supportNonDecimalIPv4 = false) - { - return static::parseString($range, ParseStringFlag::MAY_INCLUDE_PORT | ParseStringFlag::MAY_INCLUDE_ZONEID | ($supportNonDecimalIPv4 ? ParseStringFlag::IPV4_MAYBE_NON_DECIMAL : 0)); - } - - /** - * Try get the range instance starting from its string representation. - * - * @param string|mixed $range - * @param int $flags A combination or zero or more flags - * - * @return static|null - * - * @since 1.17.0 - * @see \IPLib\ParseStringFlag - */ - public static function parseString($range, $flags = 0) - { - if (!is_string($range) || strpos($range, '*') === false) { - return null; - } - if ($range === '*.*.*.*') { - return new static(IPv4::parseString('0.0.0.0'), IPv4::parseString('255.255.255.255'), 4); - } - if ($range === '*:*:*:*:*:*:*:*') { - return new static(IPv6::parseString('::'), IPv6::parseString('ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff'), 8); - } - $matches = null; - if (strpos($range, '.') !== false && preg_match('/^[^*]+((?:\.\*)+)$/', $range, $matches)) { - $asterisksCount = strlen($matches[1]) >> 1; - if ($asterisksCount > 0) { - $missingDots = 3 - substr_count($range, '.'); - if ($missingDots > 0) { - $range .= str_repeat('.*', $missingDots); - $asterisksCount += $missingDots; - } - } - $fromAddress = IPv4::parseString(str_replace('*', '0', $range), $flags); - if ($fromAddress === null) { - return null; - } - $fixedBytes = array_slice($fromAddress->getBytes(), 0, -$asterisksCount); - $otherBytes = array_fill(0, $asterisksCount, 255); - $toAddress = IPv4::fromBytes(array_merge($fixedBytes, $otherBytes)); - - return new static($fromAddress, $toAddress, $asterisksCount); - } - if (strpos($range, ':') !== false && preg_match('/^[^*]+((?::\*)+)$/', $range, $matches)) { - $asterisksCount = strlen($matches[1]) >> 1; - $fromAddress = IPv6::parseString(str_replace('*', '0', $range)); - if ($fromAddress === null) { - return null; - } - $fixedWords = array_slice($fromAddress->getWords(), 0, -$asterisksCount); - $otherWords = array_fill(0, $asterisksCount, 0xffff); - $toAddress = IPv6::fromWords(array_merge($fixedWords, $otherWords)); - - return new static($fromAddress, $toAddress, $asterisksCount); - } - - return null; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::toString() - */ - public function toString($long = false) - { - if ($this->asterisksCount === 0) { - return $this->fromAddress->toString($long); - } - switch (true) { - case $this->fromAddress instanceof \IPLib\Address\IPv4: - $chunks = explode('.', $this->fromAddress->toString()); - $chunks = array_slice($chunks, 0, -$this->asterisksCount); - $chunks = array_pad($chunks, 4, '*'); - $result = implode('.', $chunks); - break; - case $this->fromAddress instanceof \IPLib\Address\IPv6: - if ($long) { - $chunks = explode(':', $this->fromAddress->toString(true)); - $chunks = array_slice($chunks, 0, -$this->asterisksCount); - $chunks = array_pad($chunks, 8, '*'); - $result = implode(':', $chunks); - } elseif ($this->asterisksCount === 8) { - $result = '*:*:*:*:*:*:*:*'; - } else { - $bytes = $this->toAddress->getBytes(); - $bytes = array_slice($bytes, 0, -$this->asterisksCount * 2); - $bytes = array_pad($bytes, 16, 1); - $address = IPv6::fromBytes($bytes); - $before = substr($address->toString(false), 0, -strlen(':101') * $this->asterisksCount); - $result = $before . str_repeat(':*', $this->asterisksCount); - } - break; - default: - throw new \Exception('@todo'); // @codeCoverageIgnore - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getAddressType() - */ - public function getAddressType() - { - return $this->fromAddress->getAddressType(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getStartAddress() - */ - public function getStartAddress() - { - return $this->fromAddress; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getEndAddress() - */ - public function getEndAddress() - { - return $this->toAddress; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getComparableStartString() - */ - public function getComparableStartString() - { - return $this->fromAddress->getComparableString(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getComparableEndString() - */ - public function getComparableEndString() - { - return $this->toAddress->getComparableString(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::asSubnet() - * @since 1.8.0 - */ - public function asSubnet() - { - return new Subnet($this->getStartAddress(), $this->getEndAddress(), $this->getNetworkPrefix()); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::asPattern() - */ - public function asPattern() - { - return $this; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getSubnetMask() - */ - public function getSubnetMask() - { - if ($this->getAddressType() !== AddressType::T_IPv4) { - return null; - } - switch ($this->asterisksCount) { - case 0: - $bytes = array(255, 255, 255, 255); - break; - case 4: - $bytes = array(0, 0, 0, 0); - break; - default: - $bytes = array_pad(array_fill(0, 4 - $this->asterisksCount, 255), 4, 0); - break; - } - - return IPv4::fromBytes($bytes); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getReverseDNSLookupName() - */ - public function getReverseDNSLookupName() - { - return $this->asterisksCount === 0 ? array($this->getStartAddress()->getReverseDNSLookupName()) : $this->asSubnet()->getReverseDNSLookupName(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getSize() - */ - public function getSize() - { - $fromAddress = $this->fromAddress; - $maxPrefix = $fromAddress::getNumberOfBits(); - $prefix = $this->getNetworkPrefix(); - - return pow(2, ($maxPrefix - $prefix)); - } - - /** - * @return float|int - */ - private function getNetworkPrefix() - { - switch ($this->getAddressType()) { - case AddressType::T_IPv4: - return 8 * (4 - $this->asterisksCount); - case AddressType::T_IPv6: - return 16 * (8 - $this->asterisksCount); - } - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Range/RangeInterface.php b/app/vendor/mlocati/ip-lib/src/Range/RangeInterface.php deleted file mode 100644 index 4d4d834..0000000 --- a/app/vendor/mlocati/ip-lib/src/Range/RangeInterface.php +++ /dev/null @@ -1,160 +0,0 @@ -address = $address; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::__toString() - */ - public function __toString() - { - return $this->address->__toString(); - } - - /** - * @deprecated since 1.17.0: use the parseString() method instead. - * For upgrading: - * - if $supportNonDecimalIPv4 is true, use the ParseStringFlag::IPV4_MAYBE_NON_DECIMAL flag - * - * @param string|mixed $range - * @param bool $supportNonDecimalIPv4 - * - * @return static|null - * - * @see \IPLib\Range\Single::parseString() - * @since 1.10.0 added the $supportNonDecimalIPv4 argument - */ - public static function fromString($range, $supportNonDecimalIPv4 = false) - { - return static::parseString($range, ParseStringFlag::MAY_INCLUDE_PORT | ParseStringFlag::MAY_INCLUDE_ZONEID | ($supportNonDecimalIPv4 ? ParseStringFlag::IPV4_MAYBE_NON_DECIMAL : 0)); - } - - /** - * Try get the range instance starting from its string representation. - * - * @param string|mixed $range - * @param int $flags A combination or zero or more flags - * - * @return static|null - * - * @see \IPLib\ParseStringFlag - * @since 1.17.0 - */ - public static function parseString($range, $flags = 0) - { - $result = null; - $flags = (int) $flags; - $address = Factory::parseAddressString($range, $flags); - if ($address !== null) { - $result = new static($address); - } - - return $result; - } - - /** - * Create the range instance starting from an address instance. - * - * @param \IPLib\Address\AddressInterface $address - * - * @return static - * - * @since 1.2.0 - */ - public static function fromAddress(AddressInterface $address) - { - return new static($address); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::toString() - */ - public function toString($long = false) - { - return $this->address->toString($long); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getAddressType() - */ - public function getAddressType() - { - return $this->address->getAddressType(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getRangeType() - */ - public function getRangeType() - { - return $this->address->getRangeType(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::contains() - */ - public function contains(AddressInterface $address) - { - $result = false; - if ($address->getAddressType() === $this->getAddressType()) { - if ($address->toString(false) === $this->address->toString(false)) { - $result = true; - } - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::containsRange() - */ - public function containsRange(RangeInterface $range) - { - $result = false; - if ($range->getAddressType() === $this->getAddressType()) { - if ($range->toString(false) === $this->toString(false)) { - $result = true; - } - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getStartAddress() - */ - public function getStartAddress() - { - return $this->address; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getEndAddress() - */ - public function getEndAddress() - { - return $this->address; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getComparableStartString() - */ - public function getComparableStartString() - { - return $this->address->getComparableString(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getComparableEndString() - */ - public function getComparableEndString() - { - return $this->address->getComparableString(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::asSubnet() - */ - public function asSubnet() - { - $networkPrefixes = array( - AddressType::T_IPv4 => 32, - AddressType::T_IPv6 => 128, - ); - - return new Subnet($this->address, $this->address, $networkPrefixes[$this->address->getAddressType()]); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::asPattern() - */ - public function asPattern() - { - return new Pattern($this->address, $this->address, 0); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getSubnetMask() - */ - public function getSubnetMask() - { - if ($this->getAddressType() !== AddressType::T_IPv4) { - return null; - } - - return IPv4::fromBytes(array(255, 255, 255, 255)); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getReverseDNSLookupName() - */ - public function getReverseDNSLookupName() - { - return array($this->getStartAddress()->getReverseDNSLookupName()); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getSize() - */ - public function getSize() - { - return 1; - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Range/Subnet.php b/app/vendor/mlocati/ip-lib/src/Range/Subnet.php deleted file mode 100644 index ea39762..0000000 --- a/app/vendor/mlocati/ip-lib/src/Range/Subnet.php +++ /dev/null @@ -1,354 +0,0 @@ -fromAddress = $fromAddress; - $this->toAddress = $toAddress; - $this->networkPrefix = $networkPrefix; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::__toString() - */ - public function __toString() - { - return $this->toString(); - } - - /** - * @deprecated since 1.17.0: use the parseString() method instead. - * For upgrading: - * - if $supportNonDecimalIPv4 is true, use the ParseStringFlag::IPV4_MAYBE_NON_DECIMAL flag - * - * @param string|mixed $range - * @param bool $supportNonDecimalIPv4 - * - * @return static|null - * - * @see \IPLib\Range\Subnet::parseString() - * @since 1.10.0 added the $supportNonDecimalIPv4 argument - */ - public static function fromString($range, $supportNonDecimalIPv4 = false) - { - return static::parseString($range, ParseStringFlag::MAY_INCLUDE_PORT | ParseStringFlag::MAY_INCLUDE_ZONEID | ($supportNonDecimalIPv4 ? ParseStringFlag::IPV4_MAYBE_NON_DECIMAL : 0)); - } - - /** - * Try get the range instance starting from its string representation. - * - * @param string|mixed $range - * @param int $flags A combination or zero or more flags - * - * @return static|null - * - * @see \IPLib\ParseStringFlag - * @since 1.17.0 - */ - public static function parseString($range, $flags = 0) - { - if (!is_string($range)) { - return null; - } - $parts = explode('/', $range); - if (count($parts) !== 2) { - return null; - } - $flags = (int) $flags; - if (strpos($parts[0], ':') === false && $flags & ParseStringFlag::IPV4SUBNET_MAYBE_COMPACT) { - $missingDots = 3 - substr_count($parts[0], '.'); - if ($missingDots > 0) { - $parts[0] .= str_repeat('.0', $missingDots); - } - } - $address = Factory::parseAddressString($parts[0], $flags); - if ($address === null) { - return null; - } - if (!preg_match('/^[0-9]{1,9}$/', $parts[1])) { - return null; - } - $networkPrefix = (int) $parts[1]; - $addressBytes = $address->getBytes(); - $totalBytes = count($addressBytes); - $numDifferentBits = $totalBytes * 8 - $networkPrefix; - if ($numDifferentBits < 0) { - return null; - } - $numSameBytes = $networkPrefix >> 3; - $sameBytes = array_slice($addressBytes, 0, $numSameBytes); - $differentBytesStart = ($totalBytes === $numSameBytes) ? array() : array_fill(0, $totalBytes - $numSameBytes, 0); - $differentBytesEnd = ($totalBytes === $numSameBytes) ? array() : array_fill(0, $totalBytes - $numSameBytes, 255); - $startSameBits = $networkPrefix % 8; - if ($startSameBits !== 0) { - $varyingByte = $addressBytes[$numSameBytes]; - $differentBytesStart[0] = $varyingByte & bindec(str_pad(str_repeat('1', $startSameBits), 8, '0', STR_PAD_RIGHT)); - $differentBytesEnd[0] = $differentBytesStart[0] + bindec(str_repeat('1', 8 - $startSameBits)); - } - - return new static( - Factory::addressFromBytes(array_merge($sameBytes, $differentBytesStart)), - Factory::addressFromBytes(array_merge($sameBytes, $differentBytesEnd)), - $networkPrefix - ); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::toString() - */ - public function toString($long = false) - { - return $this->fromAddress->toString($long) . '/' . $this->networkPrefix; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getAddressType() - */ - public function getAddressType() - { - return $this->fromAddress->getAddressType(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getStartAddress() - */ - public function getStartAddress() - { - return $this->fromAddress; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getEndAddress() - */ - public function getEndAddress() - { - return $this->toAddress; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getComparableStartString() - */ - public function getComparableStartString() - { - return $this->fromAddress->getComparableString(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getComparableEndString() - */ - public function getComparableEndString() - { - return $this->toAddress->getComparableString(); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::asSubnet() - */ - public function asSubnet() - { - return $this; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::asPattern() - * @since 1.8.0 - */ - public function asPattern() - { - $address = $this->getStartAddress(); - $networkPrefix = $this->getNetworkPrefix(); - switch ($address->getAddressType()) { - case AddressType::T_IPv4: - return $networkPrefix % 8 === 0 ? new Pattern($address, $address, 4 - $networkPrefix / 8) : null; - case AddressType::T_IPv6: - return $networkPrefix % 16 === 0 ? new Pattern($address, $address, 8 - $networkPrefix / 16) : null; - } - } - - /** - * Get the 6to4 address IPv6 address range. - * - * @return self - * - * @since 1.5.0 - */ - public static function get6to4() - { - if (self::$sixToFour === null) { - self::$sixToFour = self::parseString('2002::/16'); - } - - return self::$sixToFour; - } - - /** - * Get subnet prefix. - * - * @return int - * - * @since 1.7.0 - */ - public function getNetworkPrefix() - { - return $this->networkPrefix; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getSubnetMask() - */ - public function getSubnetMask() - { - if ($this->getAddressType() !== AddressType::T_IPv4) { - return null; - } - $bytes = array(); - $prefix = $this->getNetworkPrefix(); - while ($prefix >= 8) { - $bytes[] = 255; - $prefix -= 8; - } - if ($prefix !== 0) { - $bytes[] = bindec(str_pad(str_repeat('1', $prefix), 8, '0')); - } - $bytes = array_pad($bytes, 4, 0); - - return IPv4::fromBytes($bytes); - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getReverseDNSLookupName() - */ - public function getReverseDNSLookupName() - { - switch ($this->getAddressType()) { - case AddressType::T_IPv4: - $unitSize = 8; // bytes - $maxUnits = 4; - $isHex = false; - $rxUnit = '\d+'; - break; - case AddressType::T_IPv6: - $unitSize = 4; // nibbles - $maxUnits = 32; - $isHex = true; - $rxUnit = '[0-9A-Fa-f]'; - break; - } - $totBits = $unitSize * $maxUnits; - $prefixUnits = (int) ($this->networkPrefix / $unitSize); - $extraBits = ($totBits - $this->networkPrefix) % $unitSize; - if ($extraBits !== 0) { - $prefixUnits += 1; - } - $numVariants = 1 << $extraBits; - $result = array(); - $unitsToRemove = $maxUnits - $prefixUnits; - $initialPointer = preg_replace("/^(({$rxUnit})\.){{$unitsToRemove}}/", '', $this->getStartAddress()->getReverseDNSLookupName()); - $chunks = explode('.', $initialPointer, 2); - for ($index = 0; $index < $numVariants; $index++) { - if ($index !== 0) { - $chunks[0] = $isHex ? dechex(1 + hexdec($chunks[0])) : (string) (1 + (int) $chunks[0]); - } - $result[] = implode('.', $chunks); - } - - return $result; - } - - /** - * {@inheritdoc} - * - * @see \IPLib\Range\RangeInterface::getSize() - */ - public function getSize() - { - $fromAddress = $this->fromAddress; - $maxPrefix = $fromAddress::getNumberOfBits(); - $prefix = $this->getNetworkPrefix(); - - return pow(2, ($maxPrefix - $prefix)); - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Range/Type.php b/app/vendor/mlocati/ip-lib/src/Range/Type.php deleted file mode 100644 index b2ba8eb..0000000 --- a/app/vendor/mlocati/ip-lib/src/Range/Type.php +++ /dev/null @@ -1,152 +0,0 @@ -toSameLength($a, $b); - - return $a < $b ? -1 : ($a > $b ? 1 : 0); - } - - /** - * Add 1 to a non-negative integer represented in binary form. - * - * @param string $value - * - * @return string - */ - public function increment($value) - { - $lastZeroIndex = strrpos($value, '0'); - if ($lastZeroIndex === false) { - return '1' . str_repeat('0', strlen($value)); - } - - return ltrim(substr($value, 0, $lastZeroIndex), '0') . '1' . str_repeat('0', strlen($value) - $lastZeroIndex - 1); - } - - /** - * Calculate the bitwise AND of two non-negative integers represented in binary form. - * - * @param string $operand1 - * @param string $operand2 - * - * @return string - */ - public function andX($operand1, $operand2) - { - $operand1 = $this->reduce($operand1); - $operand2 = $this->reduce($operand2); - $numBits = min(strlen($operand1), strlen($operand2)); - $operand1 = substr(str_pad($operand1, $numBits, '0', STR_PAD_LEFT), -$numBits); - $operand2 = substr(str_pad($operand2, $numBits, '0', STR_PAD_LEFT), -$numBits); - $result = ''; - for ($index = 0; $index < $numBits; $index++) { - $result .= $operand1[$index] === '1' && $operand2[$index] === '1' ? '1' : '0'; - } - - return $this->reduce($result); - } - - /** - * Calculate the bitwise OR of two non-negative integers represented in binary form. - * - * @param string $operand1 - * @param string $operand2 - * - * @return string - */ - public function orX($operand1, $operand2) - { - list($operand1, $operand2, $numBits) = $this->toSameLength($operand1, $operand2); - $result = ''; - for ($index = 0; $index < $numBits; $index++) { - $result .= $operand1[$index] === '1' || $operand2[$index] === '1' ? '1' : '0'; - } - - return $result; - } - - /** - * Zero-padding of two non-negative integers represented in binary form, so that they have the same length. - * - * @param string $num1 - * @param string $num2 - * - * @return string[],int[] The first array element is $num1 (padded), the first array element is $num2 (padded), the third array element is the number of bits - */ - private function toSameLength($num1, $num2) - { - $num1 = $this->reduce($num1); - $num2 = $this->reduce($num2); - $numBits = max(strlen($num1), strlen($num2)); - - return array( - str_pad($num1, $numBits, '0', STR_PAD_LEFT), - str_pad($num2, $numBits, '0', STR_PAD_LEFT), - $numBits, - ); - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Service/RangesFromBoundaryCalculator.php b/app/vendor/mlocati/ip-lib/src/Service/RangesFromBoundaryCalculator.php deleted file mode 100644 index 7a127e7..0000000 --- a/app/vendor/mlocati/ip-lib/src/Service/RangesFromBoundaryCalculator.php +++ /dev/null @@ -1,168 +0,0 @@ -math = new BinaryMath(); - $this->setNumBits($numBits); - } - - /** - * Calculate the subnets describing all (and only all) the addresses between two boundaries. - * - * @param \IPLib\Address\AddressInterface $from - * @param \IPLib\Address\AddressInterface $to - * - * @return \IPLib\Range\Subnet[]|null return NULL if the two addresses have an invalid number of bits (that is, different from the one passed to the constructor of this class) - */ - public function getRanges(AddressInterface $from, AddressInterface $to) - { - if ($from->getNumberOfBits() !== $this->numBits || $to->getNumberOfBits() !== $this->numBits) { - return null; - } - if ($from->getComparableString() > $to->getComparableString()) { - list($from, $to) = array($to, $from); - } - $result = array(); - $this->calculate($this->math->reduce($from->getBits()), $this->math->reduce($to->getBits()), $this->numBits, $result); - - return $result; - } - - /** - * Set the number of bits used to represent addresses (32 for IPv4, 128 for IPv6). - * - * @param int $numBits - */ - private function setNumBits($numBits) - { - $numBits = (int) $numBits; - $masks = array(); - $unmasks = array(); - for ($bit = 0; $bit < $numBits; $bit++) { - $masks[$bit] = str_repeat('1', $numBits - $bit) . str_repeat('0', $bit); - $unmasks[$bit] = $bit === 0 ? '0' : str_repeat('1', $bit); - } - $this->numBits = $numBits; - $this->masks = $masks; - $this->unmasks = $unmasks; - } - - /** - * Calculate the subnets. - * - * @param string $start the start address (represented in reduced bit form) - * @param string $end the end address (represented in reduced bit form) - * @param int $position the number of bits in the mask we are comparing at this cycle - * @param \IPLib\Range\Subnet[] $result found ranges will be added to this variable - */ - private function calculate($start, $end, $position, array &$result) - { - if ($start === $end) { - $result[] = $this->subnetFromBits($start, $this->numBits); - - return; - } - for ($index = $position - 1; $index >= 0; $index--) { - $startMasked = $this->math->andX($start, $this->masks[$index]); - $endMasked = $this->math->andX($end, $this->masks[$index]); - if ($startMasked !== $endMasked) { - $position = $index; - break; - } - } - if ($startMasked === $start && $this->math->andX($this->math->increment($end), $this->unmasks[$position]) === '0') { - $result[] = $this->subnetFromBits($start, $this->numBits - 1 - $position); - - return; - } - $middleAddress = $this->math->orX($start, $this->unmasks[$position]); - $this->calculate($start, $middleAddress, $position, $result); - $this->calculate($this->math->increment($middleAddress), $end, $position, $result); - } - - /** - * Create an address instance starting from its bits. - * - * @param string $bits the bits of the address (represented in reduced bit form) - * - * @return \IPLib\Address\AddressInterface - */ - private function addressFromBits($bits) - { - $bits = str_pad($bits, $this->numBits, '0', STR_PAD_LEFT); - $bytes = array(); - foreach (explode("\n", trim(chunk_split($bits, 8, "\n"))) as $byteBits) { - $bytes[] = bindec($byteBits); - } - - return Factory::addressFromBytes($bytes); - } - - /** - * Create an range instance starting from the bits if the address and the length of the network prefix. - * - * @param string $bits the bits of the address (represented in reduced bit form) - * @param int $networkPrefix the length of the network prefix - * - * @return \IPLib\Range\Subnet - */ - private function subnetFromBits($bits, $networkPrefix) - { - $startAddress = $this->addressFromBits($bits); - $numOnes = $this->numBits - $networkPrefix; - if ($numOnes === 0) { - return new Subnet($startAddress, $startAddress, $networkPrefix); - } - $endAddress = $this->addressFromBits(substr($bits, 0, -$numOnes) . str_repeat('1', $numOnes)); - - return new Subnet($startAddress, $endAddress, $networkPrefix); - } -} diff --git a/app/vendor/mlocati/ip-lib/src/Service/UnsignedIntegerMath.php b/app/vendor/mlocati/ip-lib/src/Service/UnsignedIntegerMath.php deleted file mode 100644 index 3179f74..0000000 --- a/app/vendor/mlocati/ip-lib/src/Service/UnsignedIntegerMath.php +++ /dev/null @@ -1,171 +0,0 @@ -getBytesFromDecimal($m[1], $numBytes); - } - } else { - if (preg_match('/^0[Xx]0*([0-9A-Fa-f]+)$/', $value, $m)) { - return $this->getBytesFromHexadecimal($m[1], $numBytes); - } - if (preg_match('/^0+([0-7]*)$/', $value, $m)) { - return $this->getBytesFromOctal($m[1], $numBytes); - } - if (preg_match('/^[1-9][0-9]*$/', $value)) { - return $this->getBytesFromDecimal($value, $numBytes); - } - } - - // Not a valid number - return null; - } - - /** - * @return int - */ - protected function getMaxSignedInt() - { - return PHP_INT_MAX; - } - - /** - * @param string $value never zero-length, never extra leading zeroes - * @param int $numBytes - * - * @return int[]|null - */ - private function getBytesFromBits($value, $numBytes) - { - $valueLength = strlen($value); - if ($valueLength > $numBytes << 3) { - // overflow - return null; - } - $remainderBits = $valueLength % 8; - if ($remainderBits !== 0) { - $value = str_pad($value, $valueLength + 8 - $remainderBits, '0', STR_PAD_LEFT); - } - $bytes = array_map('bindec', str_split($value, 8)); - - return array_pad($bytes, -$numBytes, 0); - } - - /** - * @param string $value may be zero-length, never extra leading zeroes - * @param int $numBytes - * - * @return int[]|null - */ - private function getBytesFromOctal($value, $numBytes) - { - if ($value === '') { - return array_fill(0, $numBytes, 0); - } - $bits = implode( - '', - array_map( - function ($octalDigit) { - return str_pad(decbin(octdec($octalDigit)), 3, '0', STR_PAD_LEFT); - }, - str_split($value, 1) - ) - ); - $bits = ltrim($bits, '0'); - - return $bits === '' ? array_fill(0, $numBytes, 0) : static::getBytesFromBits($bits, $numBytes); - } - - /** - * @param string $value never zero-length, never extra leading zeroes - * @param int $numBytes - * - * @return int[]|null - */ - private function getBytesFromDecimal($value, $numBytes) - { - $valueLength = strlen($value); - $maxSignedIntLength = strlen((string) $this->getMaxSignedInt()); - if ($valueLength < $maxSignedIntLength) { - return $this->getBytesFromBits(decbin((int) $value), $numBytes); - } - // Divide by two, so that we have 1 less bit - $carry = 0; - $halfValue = ltrim( - implode( - '', - array_map( - function ($digit) use (&$carry) { - $number = $carry + (int) $digit; - $carry = ($number % 2) * 10; - - return (string) $number >> 1; - }, - str_split($value, 1) - ) - ), - '0' - ); - $halfValueBytes = $this->getBytesFromDecimal($halfValue, $numBytes); - if ($halfValueBytes === null) { - return null; - } - $carry = $carry === 0 ? 0 : 1; - $result = array_fill(0, $numBytes, 0); - for ($index = $numBytes - 1; $index >= 0; $index--) { - $byte = $carry + ($halfValueBytes[$index] << 1); - if ($byte <= 0xFF) { - $carry = 0; - } else { - $carry = ($byte & ~0xFF) >> 8; - $byte -= 0x100; - } - $result[$index] = $byte; - } - if ($carry !== 0) { - // Overflow - return null; - } - - return $result; - } - - /** - * @param string $value never zero-length, never extra leading zeroes - * @param int $numBytes - * - * @return int[]|null - */ - private function getBytesFromHexadecimal($value, $numBytes) - { - $valueLength = strlen($value); - if ($valueLength > $numBytes << 1) { - // overflow - return null; - } - $value = str_pad($value, $valueLength + $valueLength % 2, '0', STR_PAD_LEFT); - $bytes = array_map('hexdec', str_split($value, 2)); - - return array_pad($bytes, -$numBytes, 0); - } -} diff --git a/app/vendor/mobiledetect/mobiledetectlib/LICENSE.txt b/app/vendor/mobiledetect/mobiledetectlib/LICENSE.txt deleted file mode 100644 index 90e632a..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/LICENSE.txt +++ /dev/null @@ -1,48 +0,0 @@ -MIT License - -Copyright (c) <2011-2015> Serban Ghita, Nick Ilyin and contributors. - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the -"Software"), to deal in the Software without restriction, including -without limitation the rights to use, copy, modify, merge, publish, -distribute, sublicense, and/or sell copies of the Software, and to -permit persons to whom the Software is furnished to do so, subject to -the following conditions: - -The above copyright notice and this permission notice shall be included -in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. -IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY -CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - -Developer’s Certificate of Origin 1.1 - -By making a contribution to this project, I certify that: - -(a) The contribution was created in whole or in part by me and I - have the right to submit it under the open source license - indicated in the file; or - -(b) The contribution is based upon previous work that, to the best - of my knowledge, is covered under an appropriate open source - license and I have the right under that license to submit that - work with modifications, whether created in whole or in part - by me, under the same open source license (unless I am - permitted to submit under a different license), as indicated - in the file; or - -(c) The contribution was provided directly to me by some other - person who certified (a), (b) or (c) and I have not modified - it. - -(d) I understand and agree that this project and the contribution - are public and that a record of the contribution (including all - personal information I submit with it, including my sign-off) is - maintained indefinitely and may be redistributed consistent with - this project or the open source license(s) involved. diff --git a/app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.json b/app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.json deleted file mode 100644 index 0508923..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.json +++ /dev/null @@ -1 +0,0 @@ -{"version":"2.8.37","headerMatch":{"HTTP_ACCEPT":{"matches":["application\/x-obml2d","application\/vnd.rim.html","text\/vnd.wap.wml","application\/vnd.wap.xhtml+xml"]},"HTTP_X_WAP_PROFILE":null,"HTTP_X_WAP_CLIENTID":null,"HTTP_WAP_CONNECTION":null,"HTTP_PROFILE":null,"HTTP_X_OPERAMINI_PHONE_UA":null,"HTTP_X_NOKIA_GATEWAY_ID":null,"HTTP_X_ORANGE_ID":null,"HTTP_X_VODAFONE_3GPDPCONTEXT":null,"HTTP_X_HUAWEI_USERID":null,"HTTP_UA_OS":null,"HTTP_X_MOBILE_GATEWAY":null,"HTTP_X_ATT_DEVICEID":null,"HTTP_UA_CPU":{"matches":["ARM"]}},"uaHttpHeaders":["HTTP_USER_AGENT","HTTP_X_OPERAMINI_PHONE_UA","HTTP_X_DEVICE_USER_AGENT","HTTP_X_ORIGINAL_USER_AGENT","HTTP_X_SKYFIRE_PHONE","HTTP_X_BOLT_PHONE_UA","HTTP_DEVICE_STOCK_UA","HTTP_X_UCBROWSER_DEVICE_UA"],"uaMatch":{"phones":{"iPhone":"\\biPhone\\b|\\biPod\\b","BlackBerry":"BlackBerry|\\bBB10\\b|rim[0-9]+|\\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\\b-[0-9]+","Pixel":"; \\bPixel\\b","HTC":"HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\\bEVO\\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel","Nexus":"Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 5X|Nexus 6","Dell":"Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\\b001DL\\b|\\b101DL\\b|\\bGS01\\b","Motorola":"Motorola|DROIDX|DROID BIONIC|\\bDroid\\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\\bMoto E\\b|XT1068|XT1092|XT1052","Samsung":"\\bSamsung\\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F|SM-G610F|SM-G981B|SM-G892A|SM-A530F","LG":"\\bLG\\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710","Sony":"SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533|SOV34|601SO|F8332","Asus":"Asus.*Galaxy|PadFone.*Mobile","Xiaomi":"^(?!.*\\bx11\\b).*xiaomi.*$|POCOPHONE F1|MI 8|Redmi Note 9S|Redmi Note 5A Prime|N2G47H|M2001J2G|M2001J2I|M1805E10A|M2004J11G|M1902F1G|M2002J9G|M2004J19G|M2003J6A1G","NokiaLumia":"Lumia [0-9]{3,4}","Micromax":"Micromax.*\\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\\b","Palm":"PalmSource|Palm","Vertu":"Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature","Pantech":"PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790","Fly":"IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250","Wiko":"KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM","iMobile":"i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)","SimValley":"\\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\\b","Wolfgang":"AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q","Alcatel":"Alcatel","Nintendo":"Nintendo (3DS|Switch)","Amoi":"Amoi","INQ":"INQ","OnePlus":"ONEPLUS","GenericPhone":"Tapatalk|PDA;|SAGEM|\\bmmp\\b|pocket|\\bpsp\\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\\bwap\\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser"},"tablets":{"iPad":"iPad|iPad.*Mobile","NexusTablet":"Android.*Nexus[\\s]+(7|9|10)","GoogleTablet":"Android.*Pixel C","SamsungTablet":"SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-T830|SM-T837V|SM-T720|SM-T510|SM-T387V|SM-P610|SM-T290|SM-T515|SM-T590|SM-T595|SM-T725|SM-T817P|SM-P585N0|SM-T395|SM-T295|SM-T865|SM-P610N|SM-P615|SM-T970|SM-T380|SM-T5950|SM-T905|SM-T231|SM-T500|SM-T860","Kindle":"Kindle|Silk.*Accelerated|Android.*\\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\\b|Android.*Silk\/[0-9.]+ like Chrome\/[0-9.]+ (?!Mobile)","SurfaceTablet":"Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)","HPTablet":"HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10","AsusTablet":"^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\\bK00F\\b|\\bK00C\\b|\\bK00E\\b|\\bK00L\\b|TX201LA|ME176C|ME102A|\\bM80TA\\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\\bME70C\\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\\bP027\\b|\\bP024\\b|\\bP00C\\b","BlackBerryTablet":"PlayBook|RIM Tablet","HTCtablet":"HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410","MotorolaTablet":"xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617","NookTablet":"Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2","AcerTablet":"Android.*; \\b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\\b|W3-810|\\bA3-A10\\b|\\bA3-A11\\b|\\bA3-A20\\b|\\bA3-A30|A3-A40","ToshibaTablet":"Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO","LGTablet":"\\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\\b","FujitsuTablet":"Android.*\\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\\b","PrestigioTablet":"PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002","LenovoTablet":"Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304X|TB-X304F|TB-X304L|TB-X505F|TB-X505L|TB-X505X|TB-X605F|TB-X605L|TB-8703F|TB-8703X|TB-8703N|TB-8704N|TB-8704F|TB-8704X|TB-8704V|TB-7304F|TB-7304I|TB-7304X|Tab2A7-10F|Tab2A7-20F|TB2-X30L|YT3-X50L|YT3-X50F|YT3-X50M|YT-X705F|YT-X703F|YT-X703L|YT-X705L|YT-X705X|TB2-X30F|TB2-X30L|TB2-X30M|A2107A-F|A2107A-H|TB3-730F|TB3-730M|TB3-730X|TB-7504F|TB-7504X|TB-X704F|TB-X104F|TB3-X70F|TB-X705F|TB-8504F|TB3-X70L|TB3-710F|TB-X704L","DellTablet":"Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7","YarvikTablet":"Android.*\\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\\b","MedionTablet":"Android.*\\bOYO\\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB","ArnovaTablet":"97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2","IntensoTablet":"INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004","IRUTablet":"M702pro","MegafonTablet":"MegaFon V9|\\bZTE V9\\b|Android.*\\bMT7A\\b","EbodaTablet":"E-Boda (Supreme|Impresspeed|Izzycomm|Essential)","AllViewTablet":"Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)","ArchosTablet":"\\b(101G9|80G9|A101IT)\\b|Qilive 97R|Archos5|\\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\\b","AinolTablet":"NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark","NokiaLumiaTablet":"Lumia 2520","SonyTablet":"Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712","PhilipsTablet":"\\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\\b","CubeTablet":"Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT","CobyTablet":"MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010","MIDTablet":"M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10","MSITablet":"MSI \\b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\\b","SMiTTablet":"Android.*(\\bMID\\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)","RockChipTablet":"Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A","FlyTablet":"IQ310|Fly Vision","bqTablet":"Android.*(bq)?.*\\b(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))\\b|Maxwell.*Lite|Maxwell.*Plus","HuaweiTablet":"MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-L09|CMR-AL19","NecTablet":"\\bN-06D|\\bN-08D","PantechTablet":"Pantech.*P4100","BronchoTablet":"Broncho.*(N701|N708|N802|a710)","VersusTablet":"TOUCHPAD.*[78910]|\\bTOUCHTAB\\b","ZyncTablet":"z1000|Z99 2G|z930|z990|z909|Z919|z900","PositivoTablet":"TB07STA|TB10STA|TB07FTA|TB10FTA","NabiTablet":"Android.*\\bNabi","KoboTablet":"Kobo Touch|\\bK080\\b|\\bVox\\b Build|\\bArc\\b Build","DanewTablet":"DSlide.*\\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\\b","TexetTablet":"NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE","PlaystationTablet":"Playstation.*(Portable|Vita)","TrekstorTablet":"ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab","PyleAudioTablet":"\\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\\b","AdvanTablet":"Android.* \\b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\\b ","DanyTechTablet":"Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1","GalapadTablet":"Android [0-9.]+; [a-z-]+; \\bG1\\b","MicromaxTablet":"Funbook|Micromax.*\\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\\b","KarbonnTablet":"Android.*\\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\\b","AllFineTablet":"Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide","PROSCANTablet":"\\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\\b","YONESTablet":"BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026","ChangJiaTablet":"TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503","GUTablet":"TX-A1301|TX-M9002|Q702|kf026","PointOfViewTablet":"TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10","OvermaxTablet":"OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027","HCLTablet":"HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync","DPSTablet":"DPS Dream 9|DPS Dual 7","VistureTablet":"V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10","CrestaTablet":"CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989","MediatekTablet":"\\bMT8125|MT8389|MT8135|MT8377\\b","ConcordeTablet":"Concorde([ ]+)?Tab|ConCorde ReadMan","GoCleverTablet":"GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042","ModecomTablet":"FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003","VoninoTablet":"\\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\\bQ8\\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\\b","ECSTablet":"V07OT2|TM105A|S10OT1|TR10CS1","StorexTablet":"eZee[_']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab","VodafoneTablet":"SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497|VFD 1400","EssentielBTablet":"Smart[ ']?TAB[ ]+?[0-9]+|Family[ ']?TAB2","RossMoorTablet":"RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711","iMobileTablet":"i-mobile i-note","TolinoTablet":"tolino tab [0-9.]+|tolino shine","AudioSonicTablet":"\\bC-22Q|T7-QC|T-17B|T-17P\\b","AMPETablet":"Android.* A78 ","SkkTablet":"Android.* (SKYPAD|PHOENIX|CYCLOPS)","TecnoTablet":"TECNO P9|TECNO DP8D","JXDTablet":"Android.* \\b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\\b","iJoyTablet":"Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)","FX2Tablet":"FX2 PAD7|FX2 PAD10","XoroTablet":"KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151","ViewsonicTablet":"ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a","VerizonTablet":"QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1","OdysTablet":"LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\\bXELIO\\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10","CaptivaTablet":"CAPTIVA PAD","IconbitTablet":"NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S","TeclastTablet":"T98 4G|\\bP80\\b|\\bX90HD\\b|X98 Air|X98 Air 3G|\\bX89\\b|P80 3G|\\bX80h\\b|P98 Air|\\bX89HD\\b|P98 3G|\\bP90HD\\b|P89 3G|X98 3G|\\bP70h\\b|P79HD 3G|G18d 3G|\\bP79HD\\b|\\bP89s\\b|\\bA88\\b|\\bP10HD\\b|\\bP19HD\\b|G18 3G|\\bP78HD\\b|\\bA78\\b|\\bP75\\b|G17s 3G|G17h 3G|\\bP85t\\b|\\bP90\\b|\\bP11\\b|\\bP98t\\b|\\bP98HD\\b|\\bG18d\\b|\\bP85s\\b|\\bP11HD\\b|\\bP88s\\b|\\bA80HD\\b|\\bA80se\\b|\\bA10h\\b|\\bP89\\b|\\bP78s\\b|\\bG18\\b|\\bP85\\b|\\bA70h\\b|\\bA70\\b|\\bG17\\b|\\bP18\\b|\\bA80s\\b|\\bA11s\\b|\\bP88HD\\b|\\bA80h\\b|\\bP76s\\b|\\bP76h\\b|\\bP98\\b|\\bA10HD\\b|\\bP78\\b|\\bP88\\b|\\bA11\\b|\\bA10t\\b|\\bP76a\\b|\\bP76t\\b|\\bP76e\\b|\\bP85HD\\b|\\bP85a\\b|\\bP86\\b|\\bP75HD\\b|\\bP76v\\b|\\bA12\\b|\\bP75a\\b|\\bA15\\b|\\bP76Ti\\b|\\bP81HD\\b|\\bA10\\b|\\bT760VE\\b|\\bT720HD\\b|\\bP76\\b|\\bP73\\b|\\bP71\\b|\\bP72\\b|\\bT720SE\\b|\\bC520Ti\\b|\\bT760\\b|\\bT720VE\\b|T720-3GE|T720-WiFi","OndaTablet":"\\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\\b[\\s]+|V10 \\b4G\\b","JaytechTablet":"TPC-PA762","BlaupunktTablet":"Endeavour 800NG|Endeavour 1010","DigmaTablet":"\\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\\b","EvolioTablet":"ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\\bEvotab\\b|\\bNeura\\b","LavaTablet":"QPAD E704|\\bIvoryS\\b|E-TAB IVORY|\\bE-TAB\\b","AocTablet":"MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712","MpmanTablet":"MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\\bMPG7\\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010","CelkonTablet":"CT695|CT888|CT[\\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\\bCT-1\\b","WolderTablet":"miTab \\b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\\b","MediacomTablet":"M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA","MiTablet":"\\bMI PAD\\b|\\bHM NOTE 1W\\b","NibiruTablet":"Nibiru M1|Nibiru Jupiter One","NexoTablet":"NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI","LeaderTablet":"TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100","UbislateTablet":"UbiSlate[\\s]?7C","PocketBookTablet":"Pocketbook","KocasoTablet":"\\b(TB-1207)\\b","HisenseTablet":"\\b(F5281|E2371)\\b","Hudl":"Hudl HT7S3|Hudl 2","TelstraTablet":"T-Hub2","GenericTablet":"Android.*\\b97D\\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\\bA7EB\\b|CatNova8|A1_07|CT704|CT1002|\\bM721\\b|rk30sdk|\\bEVOTAB\\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\\bM6pro\\b|CT1020W|arc 10HD|\\bTP750\\b|\\bQTAQZ3\\b|WVT101|TM1088|KT107"},"browsers":{"Chrome":"\\bCrMo\\b|CriOS|Android.*Chrome\/[.0-9]* (Mobile)?","Dolfin":"\\bDolfin\\b","Opera":"Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR\/[0-9.]+$|Coast\/[0-9.]+","Skyfire":"Skyfire","Edge":"\\bEdgiOS\\b|Mobile Safari\/[.0-9]* Edge","IE":"IEMobile|MSIEMobile","Firefox":"fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS","Bolt":"bolt","TeaShark":"teashark","Blazer":"Blazer","Safari":"Version((?!\\bEdgiOS\\b).)*Mobile.*Safari|Safari.*Mobile|MobileSafari","WeChat":"\\bMicroMessenger\\b","UCBrowser":"UC.*Browser|UCWEB","baiduboxapp":"baiduboxapp","baidubrowser":"baidubrowser","DiigoBrowser":"DiigoBrowser","Mercury":"\\bMercury\\b","ObigoBrowser":"Obigo","NetFront":"NF-Browser","GenericBrowser":"NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger","PaleMoon":"Android.*PaleMoon|Mobile.*PaleMoon"},"os":{"AndroidOS":"Android","BlackBerryOS":"blackberry|\\bBB10\\b|rim tablet os","PalmOS":"PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino","SymbianOS":"Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\\bS60\\b","WindowsMobileOS":"Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Windows Mobile|Windows Phone [0-9.]+|WCE;","WindowsPhoneOS":"Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;","iOS":"\\biPhone.*Mobile|\\biPod|\\biPad|AppleCoreMedia","iPadOS":"CPU OS 13","SailfishOS":"Sailfish","MeeGoOS":"MeeGo","MaemoOS":"Maemo","JavaOS":"J2ME\/|\\bMIDP\\b|\\bCLDC\\b","webOS":"webOS|hpwOS","badaOS":"\\bBada\\b","BREWOS":"BREW"},"utilities":{"Bot":"Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot","MobileBot":"Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker\/M1A1-R2D2","DesktopMode":"WPDesktop","TV":"SonyDTV|HbbTV","WebKit":"(webkit)[ \/]([\\w.]+)","Console":"\\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|PLAYSTATION|Xbox)\\b","Watch":"SM-V700"}}} \ No newline at end of file diff --git a/app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php b/app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php deleted file mode 100644 index 50a1d59..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/Mobile_Detect.php +++ /dev/null @@ -1,1683 +0,0 @@ - - * @author Nick Ilyin - * Original author: Victor Stanciu - * - * @version 2.8.37 - * - * Auto-generated isXXXX() magic methods. - * php -a examples/dump_magic_methods.php - * - * @method bool isiPhone() - * @method bool isBlackBerry() - * @method bool isPixel() - * @method bool isHTC() - * @method bool isNexus() - * @method bool isDell() - * @method bool isMotorola() - * @method bool isSamsung() - * @method bool isLG() - * @method bool isSony() - * @method bool isAsus() - * @method bool isXiaomi() - * @method bool isNokiaLumia() - * @method bool isMicromax() - * @method bool isPalm() - * @method bool isVertu() - * @method bool isPantech() - * @method bool isFly() - * @method bool isWiko() - * @method bool isiMobile() - * @method bool isSimValley() - * @method bool isWolfgang() - * @method bool isAlcatel() - * @method bool isNintendo() - * @method bool isAmoi() - * @method bool isINQ() - * @method bool isOnePlus() - * @method bool isGenericPhone() - * @method bool isiPad() - * @method bool isNexusTablet() - * @method bool isGoogleTablet() - * @method bool isSamsungTablet() - * @method bool isKindle() - * @method bool isSurfaceTablet() - * @method bool isHPTablet() - * @method bool isAsusTablet() - * @method bool isBlackBerryTablet() - * @method bool isHTCtablet() - * @method bool isMotorolaTablet() - * @method bool isNookTablet() - * @method bool isAcerTablet() - * @method bool isToshibaTablet() - * @method bool isLGTablet() - * @method bool isFujitsuTablet() - * @method bool isPrestigioTablet() - * @method bool isLenovoTablet() - * @method bool isDellTablet() - * @method bool isYarvikTablet() - * @method bool isMedionTablet() - * @method bool isArnovaTablet() - * @method bool isIntensoTablet() - * @method bool isIRUTablet() - * @method bool isMegafonTablet() - * @method bool isEbodaTablet() - * @method bool isAllViewTablet() - * @method bool isArchosTablet() - * @method bool isAinolTablet() - * @method bool isNokiaLumiaTablet() - * @method bool isSonyTablet() - * @method bool isPhilipsTablet() - * @method bool isCubeTablet() - * @method bool isCobyTablet() - * @method bool isMIDTablet() - * @method bool isMSITablet() - * @method bool isSMiTTablet() - * @method bool isRockChipTablet() - * @method bool isFlyTablet() - * @method bool isbqTablet() - * @method bool isHuaweiTablet() - * @method bool isNecTablet() - * @method bool isPantechTablet() - * @method bool isBronchoTablet() - * @method bool isVersusTablet() - * @method bool isZyncTablet() - * @method bool isPositivoTablet() - * @method bool isNabiTablet() - * @method bool isKoboTablet() - * @method bool isDanewTablet() - * @method bool isTexetTablet() - * @method bool isPlaystationTablet() - * @method bool isTrekstorTablet() - * @method bool isPyleAudioTablet() - * @method bool isAdvanTablet() - * @method bool isDanyTechTablet() - * @method bool isGalapadTablet() - * @method bool isMicromaxTablet() - * @method bool isKarbonnTablet() - * @method bool isAllFineTablet() - * @method bool isPROSCANTablet() - * @method bool isYONESTablet() - * @method bool isChangJiaTablet() - * @method bool isGUTablet() - * @method bool isPointOfViewTablet() - * @method bool isOvermaxTablet() - * @method bool isHCLTablet() - * @method bool isDPSTablet() - * @method bool isVistureTablet() - * @method bool isCrestaTablet() - * @method bool isMediatekTablet() - * @method bool isConcordeTablet() - * @method bool isGoCleverTablet() - * @method bool isModecomTablet() - * @method bool isVoninoTablet() - * @method bool isECSTablet() - * @method bool isStorexTablet() - * @method bool isVodafoneTablet() - * @method bool isEssentielBTablet() - * @method bool isRossMoorTablet() - * @method bool isiMobileTablet() - * @method bool isTolinoTablet() - * @method bool isAudioSonicTablet() - * @method bool isAMPETablet() - * @method bool isSkkTablet() - * @method bool isTecnoTablet() - * @method bool isJXDTablet() - * @method bool isiJoyTablet() - * @method bool isFX2Tablet() - * @method bool isXoroTablet() - * @method bool isViewsonicTablet() - * @method bool isVerizonTablet() - * @method bool isOdysTablet() - * @method bool isCaptivaTablet() - * @method bool isIconbitTablet() - * @method bool isTeclastTablet() - * @method bool isOndaTablet() - * @method bool isJaytechTablet() - * @method bool isBlaupunktTablet() - * @method bool isDigmaTablet() - * @method bool isEvolioTablet() - * @method bool isLavaTablet() - * @method bool isAocTablet() - * @method bool isMpmanTablet() - * @method bool isCelkonTablet() - * @method bool isWolderTablet() - * @method bool isMediacomTablet() - * @method bool isMiTablet() - * @method bool isNibiruTablet() - * @method bool isNexoTablet() - * @method bool isLeaderTablet() - * @method bool isUbislateTablet() - * @method bool isPocketBookTablet() - * @method bool isKocasoTablet() - * @method bool isHisenseTablet() - * @method bool isHudl() - * @method bool isTelstraTablet() - * @method bool isGenericTablet() - * @method bool isAndroidOS() - * @method bool isBlackBerryOS() - * @method bool isPalmOS() - * @method bool isSymbianOS() - * @method bool isWindowsMobileOS() - * @method bool isWindowsPhoneOS() - * @method bool isiOS() - * @method bool isiPadOS() - * @method bool isSailfishOS() - * @method bool isMeeGoOS() - * @method bool isMaemoOS() - * @method bool isJavaOS() - * @method bool iswebOS() - * @method bool isbadaOS() - * @method bool isBREWOS() - * @method bool isChrome() - * @method bool isDolfin() - * @method bool isOpera() - * @method bool isSkyfire() - * @method bool isEdge() - * @method bool isIE() - * @method bool isFirefox() - * @method bool isBolt() - * @method bool isTeaShark() - * @method bool isBlazer() - * @method bool isSafari() - * @method bool isWeChat() - * @method bool isUCBrowser() - * @method bool isbaiduboxapp() - * @method bool isbaidubrowser() - * @method bool isDiigoBrowser() - * @method bool isMercury() - * @method bool isObigoBrowser() - * @method bool isNetFront() - * @method bool isGenericBrowser() - * @method bool isPaleMoon() - * @method bool isBot() - * @method bool isMobileBot() - * @method bool isDesktopMode() - * @method bool isTV() - * @method bool isWebKit() - * @method bool isConsole() - * @method bool isWatch() - - */ -class Mobile_Detect -{ - /** - * Mobile detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_MOBILE = 'mobile'; - - /** - * Extended detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_EXTENDED = 'extended'; - - /** - * A frequently used regular expression to extract version #s. - * - * @deprecated since version 2.6.9 - */ - const VER = '([\w._\+]+)'; - - /** - * Top-level device. - */ - const MOBILE_GRADE_A = 'A'; - - /** - * Mid-level device. - */ - const MOBILE_GRADE_B = 'B'; - - /** - * Low-level device. - */ - const MOBILE_GRADE_C = 'C'; - - /** - * Stores the version number of the current release. - */ - const VERSION = '2.8.37'; - - /** - * A type for the version() method indicating a string return value. - */ - const VERSION_TYPE_STRING = 'text'; - - /** - * A type for the version() method indicating a float return value. - */ - const VERSION_TYPE_FLOAT = 'float'; - - /** - * A cache for resolved matches - * @var array - */ - protected $cache = array(); - - /** - * The User-Agent HTTP header is stored in here. - * @var string - */ - protected $userAgent = null; - - /** - * HTTP headers in the PHP-flavor. So HTTP_USER_AGENT and SERVER_SOFTWARE. - * @var array - */ - protected $httpHeaders = array(); - - /** - * CloudFront headers. E.g. CloudFront-Is-Desktop-Viewer, CloudFront-Is-Mobile-Viewer & CloudFront-Is-Tablet-Viewer. - * @var array - */ - protected $cloudfrontHeaders = array(); - - /** - * The matching Regex. - * This is good for debug. - * @var string - */ - protected $matchingRegex = null; - - /** - * The matches extracted from the regex expression. - * This is good for debug. - * - * @var string - */ - protected $matchesArray = null; - - /** - * The detection type, using self::DETECTION_TYPE_MOBILE or self::DETECTION_TYPE_EXTENDED. - * - * @deprecated since version 2.6.9 - * - * @var string - */ - protected $detectionType = self::DETECTION_TYPE_MOBILE; - - /** - * HTTP headers that trigger the 'isMobile' detection - * to be true. - * - * @var array - */ - protected static $mobileHeaders = array( - - 'HTTP_ACCEPT' => array('matches' => array( - // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/ - 'application/x-obml2d', - // BlackBerry devices. - 'application/vnd.rim.html', - 'text/vnd.wap.wml', - 'application/vnd.wap.xhtml+xml' - )), - 'HTTP_X_WAP_PROFILE' => null, - 'HTTP_X_WAP_CLIENTID' => null, - 'HTTP_WAP_CONNECTION' => null, - 'HTTP_PROFILE' => null, - // Reported by Opera on Nokia devices (eg. C3). - 'HTTP_X_OPERAMINI_PHONE_UA' => null, - 'HTTP_X_NOKIA_GATEWAY_ID' => null, - 'HTTP_X_ORANGE_ID' => null, - 'HTTP_X_VODAFONE_3GPDPCONTEXT' => null, - 'HTTP_X_HUAWEI_USERID' => null, - // Reported by Windows Smartphones. - 'HTTP_UA_OS' => null, - // Reported by Verizon, Vodafone proxy system. - 'HTTP_X_MOBILE_GATEWAY' => null, - // Seen this on HTC Sensation. SensationXE_Beats_Z715e. - 'HTTP_X_ATT_DEVICEID' => null, - // Seen this on a HTC. - 'HTTP_UA_CPU' => array('matches' => array('ARM')), - ); - - /** - * List of mobile devices (phones). - * - * @var array - */ - protected static $phoneDevices = array( - 'iPhone' => '\biPhone\b|\biPod\b', // |\biTunes - 'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+|\b(BBA100|BBB100|BBD100|BBE100|BBF100|STH100)\b-[0-9]+', - 'Pixel' => '; \bPixel\b', - 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m|Android [0-9.]+; Pixel', - 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 5X|Nexus 6', - // @todo: Is 'Dell Streak' a tablet or a phone? ;) - 'Dell' => 'Dell[;]? (Streak|Aero|Venue|Venue Pro|Flash|Smoke|Mini 3iX)|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b', - 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b|XT1068|XT1092|XT1052', - 'Samsung' => '\bSamsung\b|SM-G950F|SM-G955F|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C|SM-A310F|GT-I9190|SM-J500FN|SM-G903F|SM-J330F|SM-G610F|SM-G981B|SM-G892A|SM-A530F', - 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323|M257)|LM-G710', - 'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533|SOV34|601SO|F8332', - 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile', - 'Xiaomi' => '^(?!.*\bx11\b).*xiaomi.*$|POCOPHONE F1|MI 8|Redmi Note 9S|Redmi Note 5A Prime|N2G47H|M2001J2G|M2001J2I|M1805E10A|M2004J11G|M1902F1G|M2002J9G|M2004J19G|M2003J6A1G', - 'NokiaLumia' => 'Lumia [0-9]{3,4}', - // http://www.micromaxinfo.com/mobiles/smartphones - // Added because the codes might conflict with Acer Tablets. - 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b', - // @todo Complete the regex. - 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; - 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) - // http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH) - // Most of the VEGA devices are legacy. PANTECH seem to be newer devices based on Android. - 'Pantech' => 'PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790', - // http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones. - 'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250', - // http://fr.wikomobile.com - 'Wiko' => 'KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM', - 'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)', - // Added simvalley mobile just for fun. They have some interesting devices. - // http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html - 'SimValley' => '\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b', - // Wolfgang - a brand that is sold by Aldi supermarkets. - // http://www.wolfgangmobile.com/ - 'Wolfgang' => 'AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q', - 'Alcatel' => 'Alcatel', - 'Nintendo' => 'Nintendo (3DS|Switch)', - // http://en.wikipedia.org/wiki/Amoi - 'Amoi' => 'Amoi', - // http://en.wikipedia.org/wiki/INQ - 'INQ' => 'INQ', - 'OnePlus' => 'ONEPLUS', - // @Tapatalk is a mobile app; http://support.tapatalk.com/threads/smf-2-0-2-os-and-browser-detection-plugin-and-tapatalk.15565/#post-79039 - 'GenericPhone' => 'Tapatalk|PDA;|SAGEM|\bmmp\b|pocket|\bpsp\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\bwap\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser', - ); - - /** - * List of tablet devices. - * - * @var array - */ - protected static $tabletDevices = array( - // @todo: check for mobile friendly emails topic. - 'iPad' => 'iPad|iPad.*Mobile', - // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$ - // @see #442 - // @todo Merge NexusTablet into GoogleTablet. - 'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)', - // https://en.wikipedia.org/wiki/Pixel_C - 'GoogleTablet' => 'Android.*Pixel C', - 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-T116BU|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y?|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587|SM-P350|SM-P555M|SM-P355M|SM-T113NU|SM-T815Y|SM-T585|SM-T285|SM-T825|SM-W708|SM-T835|SM-T830|SM-T837V|SM-T720|SM-T510|SM-T387V|SM-P610|SM-T290|SM-T515|SM-T590|SM-T595|SM-T725|SM-T817P|SM-P585N0|SM-T395|SM-T295|SM-T865|SM-P610N|SM-P615|SM-T970|SM-T380|SM-T5950|SM-T905|SM-T231|SM-T500|SM-T860', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone. - // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html - 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)', - // Only the Surface tablets with Windows RT are considered mobile. - // http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx - 'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)', - // http://shopping1.hp.com/is-bin/INTERSHOP.enfinity/WFS/WW-USSMBPublicStore-Site/en_US/-/USD/ViewStandardCatalog-Browse?CatalogCategoryID=JfIQ7EN5lqMAAAEyDcJUDwMT - 'HPTablet' => 'HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10', - // Watch out for PadFone, see #132. - // http://www.asus.com/de/Tablets_Mobile/Memo_Pad_Products/ - 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|\bK00C\b|\bK00E\b|\bK00L\b|TX201LA|ME176C|ME102A|\bM80TA\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\bME70C\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z|\bP027\b|\bP024\b|\bP00C\b', - 'BlackBerryTablet' => 'PlayBook|RIM Tablet', - 'HTCtablet' => 'HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410', - 'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617', - 'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2', - // http://www.acer.ro/ac/ro/RO/content/drivers - // http://www.packardbell.co.uk/pb/en/GB/content/download (Packard Bell is part of Acer) - // http://us.acer.com/ac/en/US/content/group/tablets - // http://www.acer.de/ac/de/DE/content/models/tablets/ - // Can conflict with Micromax and Motorola phones codes. - 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\b|W3-810|\bA3-A10\b|\bA3-A11\b|\bA3-A20\b|\bA3-A30|A3-A40', - // http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/ - // http://us.toshiba.com/tablets/tablet-finder - // http://www.toshiba.co.jp/regza/tablet/ - 'ToshibaTablet' => 'Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO', - // http://www.nttdocomo.co.jp/english/service/developer/smart_phone/technical_info/spec/index.html - // http://www.lg.com/us/tablets - 'LGTablet' => '\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\b', - 'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b', - // Prestigio Tablets http://www.prestigio.com/support - 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002', - // http://support.lenovo.com/en_GB/downloads/default.page?# - 'LenovoTablet' => 'Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-850M|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)|TB-X103F|TB-X304X|TB-X304F|TB-X304L|TB-X505F|TB-X505L|TB-X505X|TB-X605F|TB-X605L|TB-8703F|TB-8703X|TB-8703N|TB-8704N|TB-8704F|TB-8704X|TB-8704V|TB-7304F|TB-7304I|TB-7304X|Tab2A7-10F|Tab2A7-20F|TB2-X30L|YT3-X50L|YT3-X50F|YT3-X50M|YT-X705F|YT-X703F|YT-X703L|YT-X705L|YT-X705X|TB2-X30F|TB2-X30L|TB2-X30M|A2107A-F|A2107A-H|TB3-730F|TB3-730M|TB3-730X|TB-7504F|TB-7504X|TB-X704F|TB-X104F|TB3-X70F|TB-X705F|TB-8504F|TB3-X70L|TB3-710F|TB-X704L', - // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets - 'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7', - // http://www.yarvik.com/en/matrix/tablets/ - 'YarvikTablet' => 'Android.*\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\b', - 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB', - 'ArnovaTablet' => '97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2', - // http://www.intenso.de/kategorie_en.php?kategorie=33 - // @todo: http://www.nbhkdz.com/read/b8e64202f92a2df129126bff.html - investigate - 'IntensoTablet' => 'INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004', - // IRU.ru Tablets http://www.iru.ru/catalog/soho/planetable/ - 'IRUTablet' => 'M702pro', - 'MegafonTablet' => 'MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b', - // http://www.e-boda.ro/tablete-pc.html - 'EbodaTablet' => 'E-Boda (Supreme|Impresspeed|Izzycomm|Essential)', - // http://www.allview.ro/produse/droseries/lista-tablete-pc/ - 'AllViewTablet' => 'Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)', - // http://wiki.archosfans.com/index.php?title=Main_Page - // @note Rewrite the regex format after we add more UAs. - 'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|Archos5|\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\b', - // http://www.ainol.com/plugin.php?identifier=ainol&module=product - 'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark', - 'NokiaLumiaTablet' => 'Lumia 2520', - // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER - // Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser - // http://www.sony.jp/support/tablet/ - 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP641|SGP612|SOT31|SGP771|SGP611|SGP612|SGP712', - // http://www.support.philips.com/support/catalog/worldproducts.jsp?userLanguage=en&userCountry=cn&categoryid=3G_LTE_TABLET_SU_CN_CARE&title=3G%20tablets%20/%20LTE%20range&_dyncharset=UTF-8 - 'PhilipsTablet' => '\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b', - // db + http://www.cube-tablet.com/buy-products.html - 'CubeTablet' => 'Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT', - // http://www.cobyusa.com/?p=pcat&pcat_id=3001 - 'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010', - // http://www.match.net.cn/products.asp - 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10', - // http://www.msi.com/support - // @todo Research the Windows Tablets. - 'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b', - // @todo http://www.kyoceramobile.com/support/drivers/ - // 'KyoceraTablet' => null, - // @todo http://intexuae.com/index.php/category/mobile-devices/tablets-products/ - // 'IntextTablet' => null, - // http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets) - // http://www.imp3.net/14/show.php?itemid=20454 - 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)', - // http://www.rock-chips.com/index.php?do=prod&pid=2 - 'RockChipTablet' => 'Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A', - // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/ - 'FlyTablet' => 'IQ310|Fly Vision', - // http://www.bqreaders.com/gb/tablets-prices-sale.html - 'bqTablet' => 'Android.*(bq)?.*\b(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris ([E|M]10|M8))\b|Maxwell.*Lite|Maxwell.*Plus', - // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290 - // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets) - 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim|M2-A01L|BAH-L09|BAH-W09|AGS-L09|CMR-AL19', - // Nec or Medias Tab - 'NecTablet' => '\bN-06D|\bN-08D', - // Pantech Tablets: http://www.pantechusa.com/phones/ - 'PantechTablet' => 'Pantech.*P4100', - // Broncho Tablets: http://www.broncho.cn/ (hard to find) - 'BronchoTablet' => 'Broncho.*(N701|N708|N802|a710)', - // http://versusuk.com/support.html - 'VersusTablet' => 'TOUCHPAD.*[78910]|\bTOUCHTAB\b', - // http://www.zync.in/index.php/our-products/tablet-phablets - 'ZyncTablet' => 'z1000|Z99 2G|z930|z990|z909|Z919|z900', // Removed "z999" because of https://github.com/serbanghita/Mobile-Detect/issues/717 - // http://www.positivoinformatica.com.br/www/pessoal/tablet-ypy/ - 'PositivoTablet' => 'TB07STA|TB10STA|TB07FTA|TB10FTA', - // https://www.nabitablet.com/ - 'NabiTablet' => 'Android.*\bNabi', - 'KoboTablet' => 'Kobo Touch|\bK080\b|\bVox\b Build|\bArc\b Build', - // French Danew Tablets http://www.danew.com/produits-tablette.php - 'DanewTablet' => 'DSlide.*\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\b', - // Texet Tablets and Readers http://www.texet.ru/tablet/ - 'TexetTablet' => 'NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE', - // Avoid detecting 'PLAYSTATION 3' as mobile. - 'PlaystationTablet' => 'Playstation.*(Portable|Vita)', - // http://www.trekstor.de/surftabs.html - 'TrekstorTablet' => 'ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab', - // http://www.pyleaudio.com/Products.aspx?%2fproducts%2fPersonal-Electronics%2fTablets - 'PyleAudioTablet' => '\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\b', - // http://www.advandigital.com/index.php?link=content-product&jns=JP001 - // because of the short codenames we have to include whitespaces to reduce the possible conflicts. - 'AdvanTablet' => 'Android.* \b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\b ', - // http://www.danytech.com/category/tablet-pc - 'DanyTechTablet' => 'Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1', - // http://www.galapad.net/product.html ; https://github.com/serbanghita/Mobile-Detect/issues/761 - 'GalapadTablet' => 'Android [0-9.]+; [a-z-]+; \bG1\b', - // http://www.micromaxinfo.com/tablet/funbook - 'MicromaxTablet' => 'Funbook|Micromax.*\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\b', - // http://www.karbonnmobiles.com/products_tablet.php - 'KarbonnTablet' => 'Android.*\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\b', - // http://www.myallfine.com/Products.asp - 'AllFineTablet' => 'Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide', - // http://www.proscanvideo.com/products-search.asp?itemClass=TABLET&itemnmbr= - 'PROSCANTablet' => '\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\b', - // http://www.yonesnav.com/products/products.php - 'YONESTablet' => 'BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026', - // http://www.cjshowroom.com/eproducts.aspx?classcode=004001001 - // China manufacturer makes tablets for different small brands (eg. http://www.zeepad.net/index.html) - 'ChangJiaTablet' => 'TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503', - // http://www.gloryunion.cn/products.asp - // http://www.allwinnertech.com/en/apply/mobile.html - // http://www.ptcl.com.pk/pd_content.php?pd_id=284 (EVOTAB) - // @todo: Softwiner tablets? - // aka. Cute or Cool tablets. Not sure yet, must research to avoid collisions. - 'GUTablet' => 'TX-A1301|TX-M9002|Q702|kf026', // A12R|D75A|D77|D79|R83|A95|A106C|R15|A75|A76|D71|D72|R71|R73|R77|D82|R85|D92|A97|D92|R91|A10F|A77F|W71F|A78F|W78F|W81F|A97F|W91F|W97F|R16G|C72|C73E|K72|K73|R96G - // http://www.pointofview-online.com/showroom.php?shop_mode=product_listing&category_id=118 - 'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10', - // http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/ - // @todo: add more tests. - 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)|Qualcore 1027', - // http://hclmetablet.com/India/index.php - 'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync', - // http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html - 'DPSTablet' => 'DPS Dream 9|DPS Dual 7', - // http://www.visture.com/index.asp - 'VistureTablet' => 'V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10', - // http://www.mijncresta.nl/tablet - 'CrestaTablet' => 'CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989', - // MediaTek - http://www.mediatek.com/_en/01_products/02_proSys.php?cata_sn=1&cata1_sn=1&cata2_sn=309 - 'MediatekTablet' => '\bMT8125|MT8389|MT8135|MT8377\b', - // Concorde tab - 'ConcordeTablet' => 'Concorde([ ]+)?Tab|ConCorde ReadMan', - // GoClever Tablets - http://www.goclever.com/uk/products,c1/tablet,c5/ - 'GoCleverTablet' => 'GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042', - // Modecom Tablets - http://www.modecom.eu/tablets/portal/ - 'ModecomTablet' => 'FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003', - // Vonino Tablets - 'VoninoTablet' => '\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\bQ8\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\b', - // ECS Tablets - http://www.ecs.com.tw/ECSWebSite/Product/Product_Tablet_List.aspx?CategoryID=14&MenuID=107&childid=M_107&LanID=0 - 'ECSTablet' => 'V07OT2|TM105A|S10OT1|TR10CS1', - // Storex Tablets - http://storex.fr/espace_client/support.html - // @note: no need to add all the tablet codes since they are guided by the first regex. - 'StorexTablet' => 'eZee[_\']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab', - // Generic Vodafone tablets. - 'VodafoneTablet' => 'SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497|VFD 1400', - // French tablets - Essentiel B http://www.boulanger.fr/tablette_tactile_e-book/tablette_tactile_essentiel_b/cl_68908.htm?multiChoiceToDelete=brand&mc_brand=essentielb - // Aka: http://www.essentielb.fr/ - 'EssentielBTablet' => 'Smart[ \']?TAB[ ]+?[0-9]+|Family[ \']?TAB2', - // Ross & Moor - http://ross-moor.ru/ - 'RossMoorTablet' => 'RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711', - // i-mobile http://product.i-mobilephone.com/Mobile_Device - 'iMobileTablet' => 'i-mobile i-note', - // http://www.tolino.de/de/vergleichen/ - 'TolinoTablet' => 'tolino tab [0-9.]+|tolino shine', - // AudioSonic - a Kmart brand - // http://www.kmart.com.au/webapp/wcs/stores/servlet/Search?langId=-1&storeId=10701&catalogId=10001&categoryId=193001&pageSize=72¤tPage=1&searchCategory=193001%2b4294965664&sortBy=p_MaxPrice%7c1 - 'AudioSonicTablet' => '\bC-22Q|T7-QC|T-17B|T-17P\b', - // AMPE Tablets - http://www.ampe.com.my/product-category/tablets/ - // @todo: add them gradually to avoid conflicts. - 'AMPETablet' => 'Android.* A78 ', - // Skk Mobile - http://skkmobile.com.ph/product_tablets.php - 'SkkTablet' => 'Android.* (SKYPAD|PHOENIX|CYCLOPS)', - // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1 - 'TecnoTablet' => 'TECNO P9|TECNO DP8D', - // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3 - 'JXDTablet' => 'Android.* \b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b', - // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/ - 'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)', - // http://www.intracon.eu/tablet - 'FX2Tablet' => 'FX2 PAD7|FX2 PAD10', - // http://www.xoro.de/produkte/ - // @note: Might be the same brand with 'Simply tablets' - 'XoroTablet' => 'KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151', - // http://www1.viewsonic.com/products/computing/tablets/ - 'ViewsonicTablet' => 'ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a', - // https://www.verizonwireless.com/tablets/verizon/ - 'VerizonTablet' => 'QTAQZ3|QTAIR7|QTAQTZ3|QTASUN1|QTASUN2|QTAXIA1', - // http://www.odys.de/web/internet-tablet_en.html - 'OdysTablet' => 'LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\bXELIO\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10', - // http://www.captiva-power.de/products.html#tablets-en - 'CaptivaTablet' => 'CAPTIVA PAD', - // IconBIT - http://www.iconbit.com/products/tablets/ - 'IconbitTablet' => 'NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S', - // http://www.teclast.com/topic.php?channelID=70&topicID=140&pid=63 - 'TeclastTablet' => 'T98 4G|\bP80\b|\bX90HD\b|X98 Air|X98 Air 3G|\bX89\b|P80 3G|\bX80h\b|P98 Air|\bX89HD\b|P98 3G|\bP90HD\b|P89 3G|X98 3G|\bP70h\b|P79HD 3G|G18d 3G|\bP79HD\b|\bP89s\b|\bA88\b|\bP10HD\b|\bP19HD\b|G18 3G|\bP78HD\b|\bA78\b|\bP75\b|G17s 3G|G17h 3G|\bP85t\b|\bP90\b|\bP11\b|\bP98t\b|\bP98HD\b|\bG18d\b|\bP85s\b|\bP11HD\b|\bP88s\b|\bA80HD\b|\bA80se\b|\bA10h\b|\bP89\b|\bP78s\b|\bG18\b|\bP85\b|\bA70h\b|\bA70\b|\bG17\b|\bP18\b|\bA80s\b|\bA11s\b|\bP88HD\b|\bA80h\b|\bP76s\b|\bP76h\b|\bP98\b|\bA10HD\b|\bP78\b|\bP88\b|\bA11\b|\bA10t\b|\bP76a\b|\bP76t\b|\bP76e\b|\bP85HD\b|\bP85a\b|\bP86\b|\bP75HD\b|\bP76v\b|\bA12\b|\bP75a\b|\bA15\b|\bP76Ti\b|\bP81HD\b|\bA10\b|\bT760VE\b|\bT720HD\b|\bP76\b|\bP73\b|\bP71\b|\bP72\b|\bT720SE\b|\bC520Ti\b|\bT760\b|\bT720VE\b|T720-3GE|T720-WiFi', - // Onda - http://www.onda-tablet.com/buy-android-onda.html?dir=desc&limit=all&order=price - 'OndaTablet' => '\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\b[\s]+|V10 \b4G\b', - 'JaytechTablet' => 'TPC-PA762', - 'BlaupunktTablet' => 'Endeavour 800NG|Endeavour 1010', - // http://www.digma.ru/support/download/ - // @todo: Ebooks also (if requested) - 'DigmaTablet' => '\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\b', - // http://www.evolioshop.com/ro/tablete-pc.html - // http://www.evolio.ro/support/downloads_static.html?cat=2 - // @todo: Research some more - 'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b', - // @todo http://www.lavamobiles.com/tablets-data-cards - 'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b', - // http://www.breezetablet.com/ - 'AocTablet' => 'MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712', - // http://www.mpmaneurope.com/en/products/internet-tablets-14/android-tablets-14/ - 'MpmanTablet' => 'MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\bMPG7\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010', - // https://www.celkonmobiles.com/?_a=categoryphones&sid=2 - 'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b', - // http://www.wolderelectronics.com/productos/manuales-y-guias-rapidas/categoria-2-miTab - 'WolderTablet' => 'miTab \b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\b', - 'MediacomTablet' => 'M-MPI10C3G|M-SP10EG|M-SP10EGP|M-SP10HXAH|M-SP7HXAH|M-SP10HXBH|M-SP8HXAH|M-SP8MXA', - // http://www.mi.com/en - 'MiTablet' => '\bMI PAD\b|\bHM NOTE 1W\b', - // http://www.nbru.cn/index.html - 'NibiruTablet' => 'Nibiru M1|Nibiru Jupiter One', - // http://navroad.com/products/produkty/tablety/ - // http://navroad.com/products/produkty/tablety/ - 'NexoTablet' => 'NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI', - // http://leader-online.com/new_site/product-category/tablets/ - // http://www.leader-online.net.au/List/Tablet - 'LeaderTablet' => 'TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100', - // http://www.datawind.com/ubislate/ - 'UbislateTablet' => 'UbiSlate[\s]?7C', - // http://www.pocketbook-int.com/ru/support - 'PocketBookTablet' => 'Pocketbook', - // http://www.kocaso.com/product_tablet.html - 'KocasoTablet' => '\b(TB-1207)\b', - // http://global.hisense.com/product/asia/tablet/Sero7/201412/t20141215_91832.htm - 'HisenseTablet' => '\b(F5281|E2371)\b', - // http://www.tesco.com/direct/hudl/ - 'Hudl' => 'Hudl HT7S3|Hudl 2', - // http://www.telstra.com.au/home-phone/thub-2/ - 'TelstraTablet' => 'T-Hub2', - 'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\bM6pro\b|CT1020W|arc 10HD|\bTP750\b|\bQTAQZ3\b|WVT101|TM1088|KT107' - ); - - /** - * List of mobile Operating Systems. - * - * @var array - */ - protected static $operatingSystems = array( - 'AndroidOS' => 'Android', - 'BlackBerryOS' => 'blackberry|\bBB10\b|rim tablet os', - 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino', - 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b', - // @reference: http://en.wikipedia.org/wiki/Windows_Mobile - 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Windows Mobile|Windows Phone [0-9.]+|WCE;', - // @reference: http://en.wikipedia.org/wiki/Windows_Phone - // http://wifeng.cn/?r=blog&a=view&id=106 - // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx - // http://msdn.microsoft.com/library/ms537503.aspx - // https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx - 'WindowsPhoneOS' => 'Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;', - 'iOS' => '\biPhone.*Mobile|\biPod|\biPad|AppleCoreMedia', - // https://en.wikipedia.org/wiki/IPadOS - 'iPadOS' => 'CPU OS 13', - // @reference https://en.m.wikipedia.org/wiki/Sailfish_OS - // https://sailfishos.org/ - 'SailfishOS' => 'Sailfish', - // http://en.wikipedia.org/wiki/MeeGo - // @todo: research MeeGo in UAs - 'MeeGoOS' => 'MeeGo', - // http://en.wikipedia.org/wiki/Maemo - // @todo: research Maemo in UAs - 'MaemoOS' => 'Maemo', - 'JavaOS' => 'J2ME/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135 - 'webOS' => 'webOS|hpwOS', - 'badaOS' => '\bBada\b', - 'BREWOS' => 'BREW', - ); - - /** - * List of mobile User Agents. - * - * IMPORTANT: This is a list of only mobile browsers. - * Mobile Detect 2.x supports only mobile browsers, - * it was never designed to detect all browsers. - * The change will come in 2017 in the 3.x release for PHP7. - * - * @var array - */ - protected static $browsers = array( - //'Vivaldi' => 'Vivaldi', - // @reference: https://developers.google.com/chrome/mobile/docs/user-agent - 'Chrome' => '\bCrMo\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?', - 'Dolfin' => '\bDolfin\b', - 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+$|Coast/[0-9.]+', - 'Skyfire' => 'Skyfire', - // Added "Edge on iOS" https://github.com/serbanghita/Mobile-Detect/issues/764 - 'Edge' => '\bEdgiOS\b|Mobile Safari/[.0-9]* Edge', - 'IE' => 'IEMobile|MSIEMobile', // |Trident/[.0-9]+ - 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS', - 'Bolt' => 'bolt', - 'TeaShark' => 'teashark', - 'Blazer' => 'Blazer', - // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3 - // Excluded "Edge on iOS" https://github.com/serbanghita/Mobile-Detect/issues/764 - 'Safari' => 'Version((?!\bEdgiOS\b).)*Mobile.*Safari|Safari.*Mobile|MobileSafari', - // http://en.wikipedia.org/wiki/Midori_(web_browser) - //'Midori' => 'midori', - //'Tizen' => 'Tizen', - 'WeChat' => '\bMicroMessenger\b', - 'UCBrowser' => 'UC.*Browser|UCWEB', - 'baiduboxapp' => 'baiduboxapp', - 'baidubrowser' => 'baidubrowser', - // https://github.com/serbanghita/Mobile-Detect/issues/7 - 'DiigoBrowser' => 'DiigoBrowser', - // http://www.puffinbrowser.com/index.php - // https://github.com/serbanghita/Mobile-Detect/issues/752 - // 'Puffin' => 'Puffin', - // http://mercury-browser.com/index.html - 'Mercury' => '\bMercury\b', - // http://en.wikipedia.org/wiki/Obigo_Browser - 'ObigoBrowser' => 'Obigo', - // http://en.wikipedia.org/wiki/NetFront - 'NetFront' => 'NF-Browser', - // @reference: http://en.wikipedia.org/wiki/Minimo - // http://en.wikipedia.org/wiki/Vision_Mobile_Browser - 'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger', - // @reference: https://en.wikipedia.org/wiki/Pale_Moon_(web_browser) - 'PaleMoon' => 'Android.*PaleMoon|Mobile.*PaleMoon', - ); - - /** - * Utilities. - * - * @var array - */ - protected static $utilities = array( - // Experimental. When a mobile device wants to switch to 'Desktop Mode'. - // http://scottcate.com/technology/windows-phone-8-ie10-desktop-or-mobile/ - // https://github.com/serbanghita/Mobile-Detect/issues/57#issuecomment-15024011 - // https://developers.facebook.com/docs/sharing/webmasters/crawler/ - 'Bot' => 'Googlebot|facebookexternalhit|Google-AMPHTML|s~amp-validator|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom|contentkingapp|AspiegelBot', - 'MobileBot' => 'Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2', - 'DesktopMode' => 'WPDesktop', - 'TV' => 'SonyDTV|HbbTV', // experimental - 'WebKit' => '(webkit)[ /]([\w.]+)', - // @todo: Include JXD consoles. - 'Console' => '\b(Nintendo|Nintendo WiiU|Nintendo 3DS|Nintendo Switch|PLAYSTATION|Xbox)\b', - 'Watch' => 'SM-V700', - ); - - /** - * All possible HTTP headers that represent the - * User-Agent string. - * - * @var array - */ - protected static $uaHttpHeaders = array( - // The default User-Agent string. - 'HTTP_USER_AGENT', - // Header can occur on devices using Opera Mini. - 'HTTP_X_OPERAMINI_PHONE_UA', - // Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/ - 'HTTP_X_DEVICE_USER_AGENT', - 'HTTP_X_ORIGINAL_USER_AGENT', - 'HTTP_X_SKYFIRE_PHONE', - 'HTTP_X_BOLT_PHONE_UA', - 'HTTP_DEVICE_STOCK_UA', - 'HTTP_X_UCBROWSER_DEVICE_UA' - ); - - /** - * The individual segments that could exist in a User-Agent string. VER refers to the regular - * expression defined in the constant self::VER. - * - * @var array - */ - protected static $properties = array( - - // Build - 'Mobile' => 'Mobile/[VER]', - 'Build' => 'Build/[VER]', - 'Version' => 'Version/[VER]', - 'VendorID' => 'VendorID/[VER]', - - // Devices - 'iPad' => 'iPad.*CPU[a-z ]+[VER]', - 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]', - 'iPod' => 'iPod.*CPU[a-z ]+[VER]', - //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'), - 'Kindle' => 'Kindle/[VER]', - - // Browser - 'Chrome' => array('Chrome/[VER]', 'CriOS/[VER]', 'CrMo/[VER]'), - 'Coast' => array('Coast/[VER]'), - 'Dolfin' => 'Dolfin/[VER]', - // @reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox - 'Firefox' => array('Firefox/[VER]', 'FxiOS/[VER]'), - 'Fennec' => 'Fennec/[VER]', - // http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx - // https://msdn.microsoft.com/en-us/library/ie/hh869301(v=vs.85).aspx - 'Edge' => 'Edge/[VER]', - 'IE' => array('IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];', 'Trident/[0-9.]+;.*rv:[VER]'), - // http://en.wikipedia.org/wiki/NetFront - 'NetFront' => 'NetFront/[VER]', - 'NokiaBrowser' => 'NokiaBrowser/[VER]', - 'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ), - 'Opera Mini' => 'Opera Mini/[VER]', - 'Opera Mobi' => 'Version/[VER]', - 'UCBrowser' => array( 'UCWEB[VER]', 'UC.*Browser/[VER]' ), - 'MQQBrowser' => 'MQQBrowser/[VER]', - 'MicroMessenger' => 'MicroMessenger/[VER]', - 'baiduboxapp' => 'baiduboxapp/[VER]', - 'baidubrowser' => 'baidubrowser/[VER]', - 'SamsungBrowser' => 'SamsungBrowser/[VER]', - 'Iron' => 'Iron/[VER]', - // @note: Safari 7534.48.3 is actually Version 5.1. - // @note: On BlackBerry the Version is overwriten by the OS. - 'Safari' => array( 'Version/[VER]', 'Safari/[VER]' ), - 'Skyfire' => 'Skyfire/[VER]', - 'Tizen' => 'Tizen/[VER]', - 'Webkit' => 'webkit[ /][VER]', - 'PaleMoon' => 'PaleMoon/[VER]', - 'SailfishBrowser' => 'SailfishBrowser/[VER]', - - // Engine - 'Gecko' => 'Gecko/[VER]', - 'Trident' => 'Trident/[VER]', - 'Presto' => 'Presto/[VER]', - 'Goanna' => 'Goanna/[VER]', - - // OS - 'iOS' => ' \bi?OS\b [VER][ ;]{1}', - 'Android' => 'Android [VER]', - 'Sailfish' => 'Sailfish [VER]', - 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]', 'Version/[VER]'), - 'BREW' => 'BREW [VER]', - 'Java' => 'Java/[VER]', - // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx - // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases - 'Windows Phone OS' => array( 'Windows Phone OS [VER]', 'Windows Phone [VER]'), - 'Windows Phone' => 'Windows Phone [VER]', - 'Windows CE' => 'Windows CE/[VER]', - // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd - 'Windows NT' => 'Windows NT [VER]', - 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'), - 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'), - ); - - /** - * Construct an instance of this class. - * - * @param array $headers Specify the headers as injection. Should be PHP _SERVER flavored. - * If left empty, will use the global _SERVER['HTTP_*'] vars instead. - * @param string $userAgent Inject the User-Agent header. If null, will use HTTP_USER_AGENT - * from the $headers array instead. - */ - public function __construct( - array $headers = null, - $userAgent = null - ) { - $this->setHttpHeaders($headers); - $this->setUserAgent($userAgent); - } - - /** - * Get the current script version. - * This is useful for the demo.php file, - * so people can check on what version they are testing - * for mobile devices. - * - * @return string The version number in semantic version format. - */ - public static function getScriptVersion() - { - return self::VERSION; - } - - /** - * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers. - * - * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract - * the headers. The default null is left for backwards compatibility. - */ - public function setHttpHeaders($httpHeaders = null) - { - // use global _SERVER if $httpHeaders aren't defined - if (!is_array($httpHeaders) || !count($httpHeaders)) { - $httpHeaders = $_SERVER; - } - - // clear existing headers - $this->httpHeaders = array(); - - // Only save HTTP headers. In PHP land, that means only _SERVER vars that - // start with HTTP_. - foreach ($httpHeaders as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $this->httpHeaders[$key] = $value; - } - } - - // In case we're dealing with CloudFront, we need to know. - $this->setCfHeaders($httpHeaders); - } - - /** - * Retrieves the HTTP headers. - * - * @return array - */ - public function getHttpHeaders() - { - return $this->httpHeaders; - } - - /** - * Retrieves a particular header. If it doesn't exist, no exception/error is caused. - * Simply null is returned. - * - * @param string $header The name of the header to retrieve. Can be HTTP compliant such as - * "User-Agent" or "X-Device-User-Agent" or can be php-esque with the - * all-caps, HTTP_ prefixed, underscore seperated awesomeness. - * - * @return string|null The value of the header. - */ - public function getHttpHeader($header) - { - // are we using PHP-flavored headers? - if (strpos($header, '_') === false) { - $header = str_replace('-', '_', $header); - $header = strtoupper($header); - } - - // test the alternate, too - $altHeader = 'HTTP_' . $header; - - //Test both the regular and the HTTP_ prefix - if (isset($this->httpHeaders[$header])) { - return $this->httpHeaders[$header]; - } elseif (isset($this->httpHeaders[$altHeader])) { - return $this->httpHeaders[$altHeader]; - } - - return null; - } - - public function getMobileHeaders() - { - return self::$mobileHeaders; - } - - /** - * Get all possible HTTP headers that - * can contain the User-Agent string. - * - * @return array List of HTTP headers. - */ - public function getUaHttpHeaders() - { - return self::$uaHttpHeaders; - } - - - /** - * Set CloudFront headers - * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device - * - * @param array $cfHeaders List of HTTP headers - * - * @return boolean If there were CloudFront headers to be set - */ - public function setCfHeaders($cfHeaders = null) { - // use global _SERVER if $cfHeaders aren't defined - if (!is_array($cfHeaders) || !count($cfHeaders)) { - $cfHeaders = $_SERVER; - } - - // clear existing headers - $this->cloudfrontHeaders = array(); - - // Only save CLOUDFRONT headers. In PHP land, that means only _SERVER vars that - // start with cloudfront-. - $response = false; - foreach ($cfHeaders as $key => $value) { - if (substr(strtolower($key), 0, 16) === 'http_cloudfront_') { - $this->cloudfrontHeaders[strtoupper($key)] = $value; - $response = true; - } - } - - return $response; - } - - /** - * Retrieves the cloudfront headers. - * - * @return array - */ - public function getCfHeaders() - { - return $this->cloudfrontHeaders; - } - - /** - * @param string $userAgent - * @return string - */ - private function prepareUserAgent($userAgent) { - $userAgent = trim($userAgent); - $userAgent = substr($userAgent, 0, 500); - return $userAgent; - } - - /** - * Set the User-Agent to be used. - * - * @param string $userAgent The user agent string to set. - * - * @return string|null - */ - public function setUserAgent($userAgent = null) - { - // Invalidate cache due to #375 - $this->cache = array(); - - if (false === empty($userAgent)) { - return $this->userAgent = $this->prepareUserAgent($userAgent); - } else { - $this->userAgent = null; - foreach ($this->getUaHttpHeaders() as $altHeader) { - if (false === empty($this->httpHeaders[$altHeader])) { // @todo: should use getHttpHeader(), but it would be slow. (Serban) - $this->userAgent .= $this->httpHeaders[$altHeader] . " "; - } - } - - if (!empty($this->userAgent)) { - return $this->userAgent = $this->prepareUserAgent($this->userAgent); - } - } - - if (count($this->getCfHeaders()) > 0) { - return $this->userAgent = 'Amazon CloudFront'; - } - return $this->userAgent = null; - } - - /** - * Retrieve the User-Agent. - * - * @return string|null The user agent if it's set. - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or - * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set. - * - * @deprecated since version 2.6.9 - * - * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default - * parameter is null which will default to self::DETECTION_TYPE_MOBILE. - */ - public function setDetectionType($type = null) - { - if ($type === null) { - $type = self::DETECTION_TYPE_MOBILE; - } - - if ($type !== self::DETECTION_TYPE_MOBILE && $type !== self::DETECTION_TYPE_EXTENDED) { - return; - } - - $this->detectionType = $type; - } - - public function getMatchingRegex() - { - return $this->matchingRegex; - } - - public function getMatchesArray() - { - return $this->matchesArray; - } - - /** - * Retrieve the list of known phone devices. - * - * @return array List of phone devices. - */ - public static function getPhoneDevices() - { - return self::$phoneDevices; - } - - /** - * Retrieve the list of known tablet devices. - * - * @return array List of tablet devices. - */ - public static function getTabletDevices() - { - return self::$tabletDevices; - } - - /** - * Alias for getBrowsers() method. - * - * @return array List of user agents. - */ - public static function getUserAgents() - { - return self::getBrowsers(); - } - - /** - * Retrieve the list of known browsers. Specifically, the user agents. - * - * @return array List of browsers / user agents. - */ - public static function getBrowsers() - { - return self::$browsers; - } - - /** - * Retrieve the list of known utilities. - * - * @return array List of utilities. - */ - public static function getUtilities() - { - return self::$utilities; - } - - /** - * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*(). - * - * @deprecated since version 2.6.9 - * - * @return array All the rules (but not extended). - */ - public static function getMobileDetectionRules() - { - static $rules; - - if (!$rules) { - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers - ); - } - - return $rules; - - } - - /** - * Method gets the mobile detection rules + utilities. - * The reason this is separate is because utilities rules - * don't necessary imply mobile. This method is used inside - * the new $detect->is('stuff') method. - * - * @deprecated since version 2.6.9 - * - * @return array All the rules + extended. - */ - public function getMobileDetectionRulesExtended() - { - static $rules; - - if (!$rules) { - // Merge all rules together. - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers, - self::$utilities - ); - } - - return $rules; - } - - /** - * Retrieve the current set of rules. - * - * @deprecated since version 2.6.9 - * - * @return array - */ - public function getRules() - { - if ($this->detectionType == self::DETECTION_TYPE_EXTENDED) { - return self::getMobileDetectionRulesExtended(); - } else { - return self::getMobileDetectionRules(); - } - } - - /** - * Retrieve the list of mobile operating systems. - * - * @return array The list of mobile operating systems. - */ - public static function getOperatingSystems() - { - return self::$operatingSystems; - } - - /** - * Check the HTTP headers for signs of mobile. - * This is the fastest mobile check possible; it's used - * inside isMobile() method. - * - * @return bool - */ - public function checkHttpHeadersForMobile() - { - - foreach ($this->getMobileHeaders() as $mobileHeader => $matchType) { - if (isset($this->httpHeaders[$mobileHeader])) { - if (isset($matchType['matches']) && is_array($matchType['matches'])) { - foreach ($matchType['matches'] as $_match) { - if (strpos($this->httpHeaders[$mobileHeader], $_match) !== false) { - return true; - } - } - - return false; - } else { - return true; - } - } - } - - return false; - - } - - /** - * Magic overloading method. - * - * @method boolean is[...]() - * @param string $name - * @param array $arguments - * @return mixed - * @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is' - */ - public function __call($name, $arguments) - { - // make sure the name starts with 'is', otherwise - if (substr($name, 0, 2) !== 'is') { - throw new BadMethodCallException("No such method exists: $name"); - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - $key = substr($name, 2); - - return $this->matchUAAgainstKey($key); - } - - /** - * Find a detection rule that matches the current User-agent. - * - * @param null $userAgent deprecated - * @return boolean - */ - protected function matchDetectionRulesAgainstUA($userAgent = null) - { - // Begin general search. - foreach ($this->getRules() as $_regex) { - if (empty($_regex)) { - continue; - } - - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * Search for a certain key in the rules array. - * If the key is found then try to match the corresponding - * regex against the User-Agent. - * - * @param string $key - * - * @return boolean - */ - protected function matchUAAgainstKey($key) - { - // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc. - $key = strtolower($key); - if (false === isset($this->cache[$key])) { - - // change the keys to lower case - $_rules = array_change_key_case($this->getRules()); - - if (false === empty($_rules[$key])) { - $this->cache[$key] = $this->match($_rules[$key]); - } - - if (false === isset($this->cache[$key])) { - $this->cache[$key] = false; - } - } - - return $this->cache[$key]; - } - - /** - * Check if the device is mobile. - * Returns true if any type of mobile device detected, including special ones - * @param null $userAgent deprecated - * @param null $httpHeaders deprecated - * @return bool - */ - public function isMobile($userAgent = null, $httpHeaders = null) - { - - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - // Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront' - if ($this->getUserAgent() === 'Amazon CloudFront') { - $cfHeaders = $this->getCfHeaders(); - if(array_key_exists('HTTP_CLOUDFRONT_IS_MOBILE_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_MOBILE_VIEWER'] === 'true') { - return true; - } - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - if ($this->checkHttpHeadersForMobile()) { - return true; - } else { - return $this->matchDetectionRulesAgainstUA(); - } - - } - - /** - * Check if the device is a tablet. - * Return true if any type of tablet device is detected. - * - * @param string $userAgent deprecated - * @param array $httpHeaders deprecated - * @return bool - */ - public function isTablet($userAgent = null, $httpHeaders = null) - { - // Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront' - if ($this->getUserAgent() === 'Amazon CloudFront') { - $cfHeaders = $this->getCfHeaders(); - if(array_key_exists('HTTP_CLOUDFRONT_IS_TABLET_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_TABLET_VIEWER'] === 'true') { - return true; - } - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - foreach (self::$tabletDevices as $_regex) { - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * This method checks for a certain property in the - * userAgent. - * @todo: The httpHeaders part is not yet used. - * - * @param string $key - * @param string $userAgent deprecated - * @param string $httpHeaders deprecated - * @return bool|int|null - */ - public function is($key, $userAgent = null, $httpHeaders = null) - { - // Set the UA and HTTP headers only if needed (eg. batch mode). - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - $this->setDetectionType(self::DETECTION_TYPE_EXTENDED); - - return $this->matchUAAgainstKey($key); - } - - /** - * Some detection rules are relative (not standard), - * because of the diversity of devices, vendors and - * their conventions in representing the User-Agent or - * the HTTP headers. - * - * This method will be used to check custom regexes against - * the User-Agent string. - * - * @param $regex - * @param string $userAgent - * @return bool - * - * @todo: search in the HTTP headers too. - */ - public function match($regex, $userAgent = null) - { - $match = (bool) preg_match(sprintf('#%s#is', $regex), (false === empty($userAgent) ? $userAgent : $this->userAgent), $matches); - // If positive match is found, store the results for debug. - if ($match) { - $this->matchingRegex = $regex; - $this->matchesArray = $matches; - } - - return $match; - } - - /** - * Get the properties array. - * - * @return array - */ - public static function getProperties() - { - return self::$properties; - } - - /** - * Prepare the version number. - * - * @todo Remove the error supression from str_replace() call. - * - * @param string $ver The string version, like "2.6.21.2152"; - * - * @return float - */ - public function prepareVersionNo($ver) - { - $ver = str_replace(array('_', ' ', '/'), '.', $ver); - $arrVer = explode('.', $ver, 2); - - if (isset($arrVer[1])) { - $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions. - } - - return (float) implode('.', $arrVer); - } - - /** - * Check the version of the given property in the User-Agent. - * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) - * - * @param string $propertyName The name of the property. See self::getProperties() array - * keys for all possible properties. - * @param string $type Either self::VERSION_TYPE_STRING to get a string value or - * self::VERSION_TYPE_FLOAT indicating a float value. This parameter - * is optional and defaults to self::VERSION_TYPE_STRING. Passing an - * invalid parameter will default to the this type as well. - * - * @return string|float The version of the property we are trying to extract. - */ - public function version($propertyName, $type = self::VERSION_TYPE_STRING) - { - if (empty($propertyName)) { - return false; - } - - // set the $type to the default if we don't recognize the type - if ($type !== self::VERSION_TYPE_STRING && $type !== self::VERSION_TYPE_FLOAT) { - $type = self::VERSION_TYPE_STRING; - } - - $properties = self::getProperties(); - - // Check if the property exists in the properties array. - if (true === isset($properties[$propertyName])) { - - // Prepare the pattern to be matched. - // Make sure we always deal with an array (string is converted). - $properties[$propertyName] = (array) $properties[$propertyName]; - - foreach ($properties[$propertyName] as $propertyMatchString) { - - $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); - - // Identify and extract the version. - preg_match(sprintf('#%s#is', $propertyPattern), $this->userAgent, $match); - - if (false === empty($match[1])) { - $version = ($type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1]); - - return $version; - } - - } - - } - - return false; - } - - /** - * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants. - * - * @return string One of the self::MOBILE_GRADE_* constants. - */ - public function mobileGrade() - { - $isMobile = $this->isMobile(); - - if ( - // Apple iOS 4-7.0 – Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3 / 5.1 / 6.1), iPad 3 (5.1 / 6.0), iPad Mini (6.1), iPad Retina (7.0), iPhone 3GS (4.3), iPhone 4 (4.3 / 5.1), iPhone 4S (5.1 / 6.0), iPhone 5 (6.0), and iPhone 5S (7.0) - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) >= 4.3 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) >= 4.3 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) >= 4.3 || - - // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) - // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM - // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices - // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 - ( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) || - - // Windows Phone 7.5-8 - Tested on the HTC Surround (7.5), HTC Trophy (7.5), LG-E900 (7.5), Nokia 800 (7.8), HTC Mazaa (7.8), Nokia Lumia 520 (8), Nokia Lumia 920 (8), HTC 8x (8) - $this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT) >= 7.5 || - - // Tested on the Torch 9800 (6) and Style 9670 (6), BlackBerry® Torch 9810 (7), BlackBerry Z10 (10) - $this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 6.0 || - // Blackberry Playbook (1.0-2.0) - Tested on PlayBook - $this->match('Playbook.*Tablet') || - - // Palm WebOS (1.4-3.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0), HP TouchPad (3.0) - ( $this->version('webOS', self::VERSION_TYPE_FLOAT) >= 1.4 && $this->match('Palm|Pre|Pixi') ) || - // Palm WebOS 3.0 - Tested on HP TouchPad - $this->match('hp.*TouchPad') || - - // Firefox Mobile 18 - Tested on Android 2.3 and 4.1 devices - ( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 18 ) || - - // Chrome for Android - Tested on Android 4.0, 4.1 device - ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 4.0 ) || - - // Skyfire 4.1 - Tested on Android 2.3 device - ( $this->is('Skyfire') && $this->version('Skyfire', self::VERSION_TYPE_FLOAT) >= 4.1 && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) || - - // Opera Mobile 11.5-12: Tested on Android 2.3 - ( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11.5 && $this->is('AndroidOS') ) || - - // Meego 1.2 - Tested on Nokia 950 and N9 - $this->is('MeeGoOS') || - - // Sailfish OS - $this->is('SailfishOS') || - - // Tizen (pre-release) - Tested on early hardware - $this->is('Tizen') || - - // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser - // @todo: more tests here! - $this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT) >= 2.0 || - - // UC Browser - Tested on Android 2.3 device - ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) || - - // Kindle 3 and Fire - Tested on the built-in WebKit browser for each - ( $this->match('Kindle Fire') || - $this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT) >= 3.0 ) || - - // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet - $this->is('AndroidOS') && $this->is('NookTablet') || - - // Chrome Desktop 16-24 - Tested on OS X 10.7 and Windows 7 - $this->version('Chrome', self::VERSION_TYPE_FLOAT) >= 16 && !$isMobile || - - // Safari Desktop 5-6 - Tested on OS X 10.7 and Windows 7 - $this->version('Safari', self::VERSION_TYPE_FLOAT) >= 5.0 && !$isMobile || - - // Firefox Desktop 10-18 - Tested on OS X 10.7 and Windows 7 - $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 10.0 && !$isMobile || - - // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 - $this->version('IE', self::VERSION_TYPE_FLOAT) >= 7.0 && !$isMobile || - - // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 - $this->version('Opera', self::VERSION_TYPE_FLOAT) >= 10 && !$isMobile - ){ - return self::MOBILE_GRADE_A; - } - - if ( - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<4.3 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT)<4.3 || - - // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 - $this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 || - - //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 - ($this->version('Opera Mini', self::VERSION_TYPE_FLOAT) >= 5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT) <= 7.0 && - ($this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 || $this->is('iOS')) ) || - - // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) - $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || - - // @todo: report this (tested on Nokia N71) - $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11 && $this->is('SymbianOS') - ){ - return self::MOBILE_GRADE_B; - } - - if ( - // Blackberry 4.x - Tested on the Curve 8330 - $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) <= 5.0 || - // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) - $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT) <= 5.2 || - - // Tested on original iPhone (3.1), iPhone 3 (3.2) - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) <= 3.2 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) <= 3.2 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) <= 3.2 || - - // Internet Explorer 7 and older - Tested on Windows XP - $this->version('IE', self::VERSION_TYPE_FLOAT) <= 7.0 && !$isMobile - ){ - return self::MOBILE_GRADE_C; - } - - // All older smartphone platforms and featurephones - Any device that doesn't support media queries - // will receive the basic, C grade experience. - return self::MOBILE_GRADE_C; - } -} diff --git a/app/vendor/mobiledetect/mobiledetectlib/README.md b/app/vendor/mobiledetect/mobiledetectlib/README.md deleted file mode 100644 index 1eda7e7..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/README.md +++ /dev/null @@ -1,344 +0,0 @@ -![Mobile Detect](http://demo.mobiledetect.net/logo-github.png) - -> Motto: "Every business should have a detection script to detect mobile readers." - -![Build status](https://github.com/serbanghita/Mobile-Detect/workflows/Mobile-Detect/badge.svg) -[![Latest Stable Version](https://poser.pugx.org/mobiledetect/mobiledetectlib/v/stable.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) -[![Total Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/downloads.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) -[![Daily Downloads](https://poser.pugx.org/mobiledetect/mobiledetectlib/d/daily.png)](https://packagist.org/packages/mobiledetect/mobiledetectlib) -[![License](https://poser.pugx.org/mobiledetect/mobiledetectlib/license.svg)](https://packagist.org/packages/mobiledetect/mobiledetectlib) -[![Chat on Slack](https://img.shields.io/badge/Slack%20%23general-join-orange.svg)](https://join.slack.com/t/mobiledetect/shared_invite/enQtMjg1NDY0OTg5NzgzLTcwMzEzMWJjZjRlOWFkY2ZiNzE1ZmRmNzEwM2VhOGY5OGVkYWMxNjdkZDU5YjQ5MmM5MGUxYjhlZDQwOGVjZjE) - -#### About - -Mobile Detect is a lightweight PHP class for detecting mobile devices (including tablets). -It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment. - -*Why* - -Your website's _content strategy_ is important! You need a complete toolkit to deliver an experience that is _optimized_, -_fast_ and _relevant_ to your users. Mobile Detect class is a -[server-side detection](http://www.w3.org/TR/mwabp/#bp-devcap-detection) tool that can help you with your RWD strategy, -it is not a replacement for CSS3 media queries or other forms of client-side feature detection. - -*How* - -We're committed to make Mobile_Detect the best open-source mobile detection resource and this is why before -each release we're running [unit tests](./tests) and research and update the detection rules on **monthly** basis. - -*Who* - -See [the history](./docs/HISTORY.md) of the project. - -#### Announcements - -* **JetBrains** is sponsoring the project by providing licenses for [PHPStorm](https://www.jetbrains.com/phpstorm/) and -[DataGrip](https://www.jetbrains.com/datagrip/). -* **Mobile_Detect `2.x.x`** is only integrating new regexes, User-Agents and tests. We are focusing on **new tablets only**. -The rest of the PRs about TVs, bots or optimizations will be closed and analyzed after `3.0.0-beta` is released. -* **Mobile_Detect `3.x.x`** is experimental and WIP. - - -#### Install - -**Download and include manually** -> Use this to quickly test the demo. - -* [Download latest release](../../tags) -* [Mobile_Detect.php](./Mobile_Detect.php) - -```php -require_once "libs/Mobile_Detect.php"; -``` - -**Install as a [composer package](https://packagist.org/packages/mobiledetect/mobiledetectlib)** -> Use this method to get continuous updates. - -``` -composer require mobiledetect/mobiledetectlib -``` -or include the dependency in the `composer.json` file: -```json -{ - "require": { - "mobiledetect/mobiledetectlib": "^2.8" - } -} -``` - -#### Demo - -* [:iphone: Live demo!](https://demo.mobiledetect.net) -* [Code examples](../../wiki/Code-examples) - -#### Contribute - -*Submit a PR* -> Submit a pull request but before make sure you read [how to contribute](docs/CONTRIBUTING.md) guide. - -*Donate* - -|Paypal| -|------| -|[Donate :+1:](https://www.paypal.com/cgi-bin/webscr?cmd=_donations&business=mobiledetectlib%40gmail%2ecom&lc=US&item_name=Mobile%20Detect¤cy_code=USD&bn=PP%2dDonationsBF%3abtn_donate_SM%2egif%3aNonHosted)| - - -I'm currently paying for hosting and spend a lot of my family time to maintain the project and planning the future releases. -I would highly appreciate any money donations that will keep the research going. - -Special thanks to the community :+1: for donations, JetBrains team for the continuous support and [Dragos Gavrila](https://twitter.com/grafician) who contributed with the logo. - -#### Modules, plugins, ports -> [Submit new module, plugin, port](../../issues/new?title=New%203rd%20party%20module&body=Name,%20Link%20and%20Description%20of%20the%20module.) - -:point_right: Keep `Mobile_Detect.php` class in a separate `module` and do NOT include it in your script core because of the high frequency of updates. -:point_right: When including the class into your `web application` or `module` always use `include_once '../path/to/Mobile_Detect.php` to prevent conflicts. - -**JavaScript** - -* mobile-detect.js - A [JavaScript port](https://github.com/hgoebl/mobile-detect.js) of Mobile-Detect class. Made by [Heinrich Goebl](https://github.com/hgoebl). - -**Varnish Cache** - -* [Varnish Mobile Detect](https://github.com/willemk/varnish-mobiletranslate) - Drop-in varnish solution to mobile user -detection based on the Mobile-Detect library. Made by [willemk](https://github.com/willemk). -* [mobiledetect2vcl](https://github.com/carlosabalde/mobiledetect2vcl) - Python script to transform the Mobile -Detect JSON database into an UA-based mobile detection VCL subroutine easily integrable in any Varnish Cache -configuration. Made by [Carlos Abalde](https://github.com/carlosabalde). - -**LUA** - -* [mobile-detect.lua](https://github.com/yourpalmark/mobile-detect.lua) is a port of Mobile-Detect to Lua for -NGINX HTTP servers. Follows closely to mobile-detect.js. Supports all methods that server-side -mobile-detect.js supports. Fully unit-tested and synced with Travis CI (Build Passing badge included). -Made by [Mark Walters](https://github.com/yourpalmark). - -**PHP** - -**WordPress** - -* [Mobile Detect for WordPress](https://wordpress.org/plugins/tinywp-mobile-detect/) - WordPress has a built-in function -(`wp_is_mobile()`) to detect mobile devices. There is (at least) one catch, though. It considers iPad (iPad pro, -and any tablet) as a mobile. So, this 3rd party module changes the way `wp_is_mobile()` works with the help of -Mobile Detect PHP library! -Made by [Pothi Kalimuthu](https://github.com/pothi) - -* [WordPress Mobile Detect](https://wordpress.org/plugins/wp-mobile-detect/) - Gives you the ability to wrap that -infographic in a `[notdevice][/notdevice]` shortcode so at the server level WordPress will -decide to show that content only if the user is NOT on a phone or tablet. -Made by [Jesse Friedman](https://profiles.wordpress.org/professor44/). - -* [mobble](https://wordpress.org/plugins/mobble/) - provides mobile related conditional functions for your site. -e.g. `is_iphone()`, `is_mobile()` and `is_tablet()`. Made by Scott Evans. - -* [WordPress Responsage](https://github.com/iamspacehead/responsage) - A small WordPress theme plugin that allows -you to make your images responsive. Made by [Adrian Ciaschetti](https://github.com/iamspacehead). - -* [WP247 Body Classes](https://wordpress.org/plugins/wp247-body-classes/) - Add unique classes to the `body` tag for -easy styling based on various attributes (archive, user, post, mobile) and various WordPress "is" functions. -Mobile attributes include type of device, Operating System, Browser, etc. Examples: .is-mobile, .is-not-mobile, -.is-tablet, .is-ios, .is-not-ios, .is-androidos, .is-chromebrowser. -Made by [wescleveland56](https://github.com/wescleveland56). - -* [Adaptive Content](https://wordpress.org/plugins/addfunc-adaptive-content/) for WordPress provides the most -intuitive set of shortcodes for including/excluding content on mobile devices, tablets desktops and other -more specific device parameters. This lightweight plugin lets content writers and theme authors choose when -WordPress should or shouldn’t show any give content item using shortcodes and quicktags or theme elements using functions. -Made by [AddFunc](https://profiles.wordpress.org/addfunc). - -* [AddFunc Mobile Detect](https://wordpress.org/plugins/addfunc-mobile-detect/) for WordPress redirects -mobile traffic to your mobile website and, basically, gives you loads of control over your mobile redirects. -Made by [AddFunc](https://profiles.wordpress.org/addfunc). - -**Drupal** - -* [Drupal Mobile Switch](https://www.drupal.org/project/mobile_switch) - The Mobile Switch Drupal module provides a -automatic theme switch functionality for mobile devices, detected by Browscap or Mobile Detect. -Made by [Siegfried Neumann](https://www.drupal.org/user/45267). - -* [Drupal Context Mobile Detect](https://www.drupal.org/project/context_mobile_detect) - This is a Drupal context module -which integrates Context and PHP Mobile Detect library. -Created by [Artem Shymko](https://www.drupal.org/user/432492). - -* [Drupal Mobile Detect](https://www.drupal.org/project/mobile_detect) - Lightweight mobile detect module for Drupal - created by [Matthew Donadio](https://www.drupal.org/user/325244). - -**Joomla** - -* [yagendoo Joomla! Mobile Detection Plugin](http://www.yagendoo.com/en/blog/free-mobile-detection-plugin-for-joomla.html) - Lightweight PHP plugin for Joomla! -that detects a mobile browser using the Mobile Detect class. -Made by yagendoo media. - -* [User Agent Detector plugin](https://github.com/renekreijveld/UserAgentDetector) - This system plugin detects the user -agent of your website visitor and sets a session variable accordingly. Based on the user agent, the plugin detects if the -site is running on a desktop pc, tablet or smartphone. It can also detect if the visitor is a spider bot (search engine). -Session variable that is set: `ualayout`. Possible values: desktop, tablet, mobile, bot. -Made by @ReneKreijveld. - -**Magento** - -* [Magento helper](http://www.magentocommerce.com/magento-connect/catalog/product/view/id/16835/) from Optimise Web enables -the use of all functions provided by Mobile Detect. Made by [Kathir Vel](http://www.kathirvel.com). - -* [Magento 2 Mobile Detect Theme Change](https://github.com/EaDesgin/magento2-mobiledetect) is an extension for Magento 2 -that will change the theme or redirect to a different URL. Also containing a helper to check for the device type. - -**PrestaShop** - -* [PrestaShop](https://www.prestashop.com) is a free, secure and open source shopping cart platform. Mobile_Detect -is included in the default package since 1.5.x. - -**Laravel** - -* [Agent](https://github.com/jenssegers/agent) is a user agent class for Laravel based on Mobile Detect with some -additional functionality. -Made by [Jens Segers](https://github.com/jenssegers). - -* [Laravel Mobile Detect](https://github.com/riverskies/laravel-mobile-detect) is a package that enables you to use device detection right in your Laravel Blade templates. (Utilises the well-known, constantly updated PHP mobile detection library.) -Made by [Barnabas Kecskes](https://github.com/barnabaskecskes). - -* [BrowserDetect](https://github.com/hisorange/browser-detect) is a browser and mobile detection package, collects -and wrap together the best user-agent identifiers for Laravel. -Created by [Varga Zsolt](https://github.com/hisorange). - -**Zend Framework** - -* [ZF2 Mobile-Detect](https://github.com/neilime/zf2-mobile-detect.git) is a Zend Framework 2 module that provides -Mobile-Detect features (Mobile_Detect class as a service, helper for views and plugin controllers). -Made by [neilime](https://github.com/neilime). - -* [ZF2 MobileDetectModule](https://github.com/nikolaposa/MobileDetectModule) facilitates integration of a PHP MobileDetect -class with some ZF2-based application. Has similar idea like the existing ZF2 Mobile-Detect module, -but differs in initialization and provision routine of the actual Mobile_Detect class. -Appropriate view helper and controller plugin also have different conceptions. -Made by [Nikola Posa](https://github.com/nikolaposa). - -**Symfony** - -* [Symfony2 Mobile Detect Bundle](https://github.com/suncat2000/MobileDetectBundle) is a bundle for detecting mobile devices, -manage mobile view and redirect to the mobile and tablet version. -Made by [Nikolay Ivlev](https://github.com/suncat2000). - -* [Silex Mobile Detect Service Provider](https://github.com/jbinfo/MobileDetectServiceProvider) is a service provider to -interact with Mobile detect class methods. -Made by [Lhassan Baazzi](https://github.com/jbinfo). - -**Slim Framework** - -* [Slim_Mobile_Detect](https://github.com/zguillez/slim_mobile_detect) implements Mobile_Detect lib for different -responses write on Slim Framework App. - -**ExpressionEngine** - -* [EE2 Detect Mobile](https://github.com/garethtdavies/detect-mobile) is a lightweight PHP plugin for EE2 that detects - a mobile browser using the Mobile Detect class. Made by [Gareth Davies](https://github.com/garethtdavies). - -**Yii Framework** - -* [Yii Extension](https://github.com/iamsalnikov/MobileDetect) - Mobile detect plugin for Yii framework. -Made by [Alexey Salnikov](https://github.com/iamsalnikov). - -* [Yii Extension](https://github.com/candasm/yii1-mobile-detect-component) - Mobile detect component for Yii framework -1.x version which supports composer package manager. Made by [Candas Minareci](https://github.com/candasm). - -* [Yii2 Device Detect](https://github.com/alexandernst/yii2-device-detect/) - Yii2 extension for Mobile-Detect library. -Made by [Alexander Nestorov](https://github.com/alexandernst). - -**CakePHP** - -* [CakePHP MobileDetect](https://github.com/chronon/CakePHP-MobileDetectComponent-Plugin) is a plugin component for -CakePHP 2.x. Made by [Gregory Gaskill](https://github.com/chronon). - -**FuelPHP** - -* [Special Agent](https://github.com/rob-bar/special_agent) is a FuelPHP package which uses php-mobile-detect to -determine whether a device is mobile or not. It overrides the Fuelphp Agent class its methods. -Made by [Robbie Bardjin](https://github.com/rob-bar). - - -**TYPO3** - -* [px_mobiledetect](https://typo3.org/extensions/repository/view/px_mobiledetect) is an extension that helps to detect -visitor's mobile device class (if that’s tablet or mobile device like smartphone). Made by Alexander Tretyak. - -**Other** - -* [PageCache](https://github.com/mmamedov/page-cache) is a lightweight PHP library for full page cache, -with built-in Mobile-Detect support. Made by [Muhammed Mamedov](https://github.com/mmamedov). - -* [Statamic CMS Mobile Detect](https://github.com/haikulab/statamic-mobile-detect) is a plugin. -Made by [Sergei Filippov](https://github.com/haikulab/statamic-mobile-detect) of Haiku Lab. - -* [Kohana Mobile Detect](https://github.com/madeinnordeste/kohana-mobile-detect) is an example of implementation of -Mobile_Detect class with Kohana framework. -Written by [Luiz Alberto S. Ribeiro](https://github.com/madeinnordeste). - -* [MemHT](https://www.memht.com) is a Free PHP CMS and Blog that permit the creation and the management online -of websites with few and easy steps. Has the class included in the core. - -* [concrete5](https://www.concrete5.org) is a CMS that is free and open source. The library is included in the core. - -* [engine7](https://github.com/QOXCorp/exengine) is PHP Open Source Framework. The Mobile_Detect class is included in -the engine. - -* [Zikula](http://zikula.org) is a free and open-source Content Management Framework, which allows you to run -impressive websites and build powerful online applications. The core uses Mobile-Detect to switch to a special -Mobile theme, using jQueryMobile. - -* [UserAgentInfo](https://github.com/quentin389/UserAgentInfo) is a PHP class for parsing user agent strings -(HTTP_USER_AGENT). Includes mobile checks, bot checks, browser types/versions and more. -Based on browscap, Mobile_Detect and ua-parser. Created for high traffic websites and fast batch processing. -Made by [quentin389](https://github.com/quentin389). - -* [LJ Mobile Detect](https://github.com/lewisjenkins/craft-lj-mobiledetect) is a simple implementation of Mobile Detect -for Craft CMS. Made by [Lewis Jenkins](https://github.com/lewisjenkins). - -* [Detect Craft](https://github.com/mmikkel/Detect-Craft) is a Craft CMS wrapper for the Mobile_Detect library. Made by [Mikkel Rummelhoff](https://github.com/mmikkel). - -* [Grav Plugin Mobile Detect](https://github.com/dimitrilongo/grav-plugin-mobile-detect/) is a simple implementation -of Mobile Detect for Grav CMS. Made by [Dimitri Longo](https://github.com/dimitrilongo). - -* [Mobile_Detect module for UliCMS](https://github.com/derUli/ulicms-Mobile_Detect). -Made by [derUli](https://github.com/derUli). - -**Perl** - - * [MobileDetect.pm](https://www.buzzerstar.com/development/) is a Perl module for Mobile Detect. - Made by [Sebastian Enger](https://devop.tools/). - -**Python** - -* [pymobiledetect](https://pypi.python.org/pypi/pymobiledetect) - Mobile detect python package. -Made by Bas van Oostveen. - -**Ruby** - -* [mobile_detect.rb](https://github.com/ktaragorn/mobile_detect) is a Ruby gem using the JSON data exposed by the -php project and implementing a basic subset of the API (as much as can be done by the exposed data). -Made by [Karthik T](https://github.com/ktaragorn). - -**Go** - -* [GoMobileDetect](https://github.com/Shaked/gomobiledetect) is a Go port of Mobile Detect class. -Made by [https://github.com/Shaked](Shaked). - - -**LUA** - -* [ua-lua](https://github.com/robinef/ua-lua) is a small lib written in LUA providing device type detection. -ua-lua is detecting mobile or tablet devices based on user-agent inside nginx daemon. -Made by [Frédéric Robinet](https://github.com/robinef). - -**.Net** - -* [mobile-detect](https://github.com/validide/mobile-detect) is a .Net partial port written in C#. -Made by [Valentin Dide](https://github.com/validide). - -**ColdFusion** - -* [MobileDetect](https://github.com/GiancarloGomez/ColdFusion-MobileDetect) is a CFC port of the -Mobile_Detect PHP Library. Made by [Giancarlo Gomez](https://github.com/GiancarloGomez). - -**Experiments** :bulb: - -* [Mobile Detect Fast](https://bitbucket.org/lanaguani/mobile-detect-fast/) (See: [#474](https://github.com/serbanghita/Mobile-Detect/issues/474)) is a class to increase the performance of Mobile Detect lib. Made by [LanaGuani](https://github.com/lanaguanifw). diff --git a/app/vendor/mobiledetect/mobiledetectlib/composer.json b/app/vendor/mobiledetect/mobiledetectlib/composer.json deleted file mode 100644 index 25cd99a..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/composer.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "name": "mobiledetect/mobiledetectlib", - "type": "library", - "description": "Mobile_Detect is a lightweight PHP class for detecting mobile devices. It uses the User-Agent string combined with specific HTTP headers to detect the mobile environment.", - "keywords": ["mobile", "mobile detect", "mobile detector", "php mobile detect", "detect mobile devices"], - "homepage": "https://github.com/serbanghita/Mobile-Detect", - "license": "MIT", - "authors": [ - { - "name": "Serban Ghita", - "email": "serbanghita@gmail.com", - "homepage": "http://mobiledetect.net", - "role": "Developer" - } - ], - "require": { - "php": ">=5.0.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.8.35||~5.7" - }, - "autoload": { - "classmap": ["Mobile_Detect.php"], - "psr-0": { - "Detection": "namespaced/" - } - }, - "archive": { - "exclude": ["docs", "examples", "export"] - } -} diff --git a/app/vendor/mobiledetect/mobiledetectlib/docker-compose.yml b/app/vendor/mobiledetect/mobiledetectlib/docker-compose.yml deleted file mode 100644 index 58ce75e..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/docker-compose.yml +++ /dev/null @@ -1,16 +0,0 @@ -app: - restart: 'on-failure' - image: php:7 - working_dir: /app - command: vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-text --strict-coverage --stop-on-risky - ports: - - "8000:8000" - volumes: - - .:/app - -composer: - restart: 'no' - image: composer/composer:php7 - command: install - volumes: - - .:/app \ No newline at end of file diff --git a/app/vendor/mobiledetect/mobiledetectlib/docs/CONTRIBUTING.md b/app/vendor/mobiledetect/mobiledetectlib/docs/CONTRIBUTING.md deleted file mode 100644 index 01a266e..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/docs/CONTRIBUTING.md +++ /dev/null @@ -1,48 +0,0 @@ -**Reporting issues** - -1. Specify the User-agent by visiting [http://demo.mobiledetect.net](http://demo.mobiledetect.net). -1. Specify the expected behaviour. - -**Developing** - -1. Fork Mobile Detect repository. See ["How to fork"](https://help.github.com/articles/fork-a-repo/#fork-an-example-repository) example. -1. `git clone https://github.com/[yourname]/Mobile-Detect.git` -1. `git add remote serbanghita https://github.com/serbanghita/Mobile-Detect.git` -1. `git remote -v` - You should see: - ``` - origin git@github.com:serbanghita/Mobile-Detect.git - serbanghita https://github.com/serbanghita/Mobile-Detect.git - ``` -1. `git checkout -b devel origin/devel` -1. `composer install` -1. Start working on your changes. - 1. If you add new methods or make structural changes to the `Mobile_Detect.php` class - you need to add unit tests! - 1. If you add new regexes make sure you commit the User-Agents in [`tests/providers/vendors`](https://github.com/serbanghita/Mobile-Detect/tree/master/tests/providers/vendors) -1. Run tests `vendor/bin/phpunit -v -c tests/phpunit.xml --coverage-text --strict-coverage --stop-on-risky` -1. `git status` or `git diff` - inspect your changes -1 `git stage .` -1. `git commit -m "[your commit message here]` -1. `git push origin devel` -1. Go to your repo on GitHub and ["Submit the PR"](https://help.github.com/articles/about-pull-requests/) - -**New module, plugin, plugin or port** - -[Submit new module, plugin, port](../../issues/new?title=New%203rd%20party%20module&body=Name,%20Link%20and%20Description%20of%20the%20module.) - including the following information: -* Module name -* Description -* Link -* Author - -Or you can submit a PR against `README.md`. - -**Website updates** - -1. Our official website is hosted at [http://mobiledetect.net](http://mobiledetect.net). -1. The files are found on the `gh-pages` branch. -1. `git checkout gh-pages` -1. `npm install -g browser-sync` -1. `browser-sync start --s . --f . --port 3000 --reload-debounce 1500 --no-ui` -1. Go to `http://localhost:3000` and make changes. -1. Commit, push and submit the PR against `serbanghita:gh-pages`. \ No newline at end of file diff --git a/app/vendor/mobiledetect/mobiledetectlib/docs/HISTORY.md b/app/vendor/mobiledetect/mobiledetectlib/docs/HISTORY.md deleted file mode 100644 index 3483985..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/docs/HISTORY.md +++ /dev/null @@ -1,11 +0,0 @@ -The first version of the script was developed in 2009 and it was hosted at https://code.google.com/p/php-mobile-detect/, it was a small project with around 30 stars. (Original blog post by Victor: http://victorstanciu.ro/detectarea-platformelor-mobile-in-php/) - -In December 2011 it received a major update from the first version, an important number of issues were fixed, then 2.0 was launched. The new version marks a new mindset and also featuring tablet detection. - -Throughout 2012 the script has been updated constantly and we have received tons of feedback and requests. - -In July 2012 we moved the repository from Google Code to GitHub in order to quickly accommodate the frequent updates and to involve more people. - -In August 2013 the library has 1800+ stargazers and support for: composer, PHPUnit tests, PSR standards and a new webpage http://mobiledetect.net - -Mobile Detect library and user contributions are MIT Licensed. diff --git a/app/vendor/mobiledetect/mobiledetectlib/docs/ISSUE_TEMPLATE.md b/app/vendor/mobiledetect/mobiledetectlib/docs/ISSUE_TEMPLATE.md deleted file mode 100644 index 8d6384f..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/docs/ISSUE_TEMPLATE.md +++ /dev/null @@ -1,15 +0,0 @@ --------------delete this message------------- -* By submitting a new issue I acknowledge that I already read the README, CODE EXAMPLES and KNOWN LIMITATIONS. -* I understand that the current version `2.x` is only meant to detect `mobile` devices. -* Please post your User-Agent string! On a real device/s, the library is expected to work correctly. --------------delete this message------------- - - - -**Issue description** - - -**User-Agent(s)** - - -**Suggestions** \ No newline at end of file diff --git a/app/vendor/mobiledetect/mobiledetectlib/docs/KNOWN_LIMITATIONS.md b/app/vendor/mobiledetect/mobiledetectlib/docs/KNOWN_LIMITATIONS.md deleted file mode 100644 index 4dd191a..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/docs/KNOWN_LIMITATIONS.md +++ /dev/null @@ -1,14 +0,0 @@ -**Known limitations** - -* Mobile Detect script was designed to detect `mobile` devices. Implicitly other devices are considered to be `desktop`. -* User-Agent and HTTP headers sniffing is a non-reliable method of detecting a mobile device. -* If the mobile browser is set on `Desktop mode`, the Mobile Detect script has no indicator (eg. a group of strings) that would allow it to detect that the device is `mobile`. -* Ipad 2019 is being recognized as a desktop because of Safari's default `Request Desktop Website` setting. See details and possible workaround [#820](https://github.com/serbanghita/Mobile-Detect/issues/820) -* Some touchscreen devices (eg. Microsoft Surface) are tough to detect as mobile since they can be used in a laptop mode. See: [#32](https://github.com/serbanghita/Mobile-Detect/issues/32), [#461](https://github.com/serbanghita/Mobile-Detect/issues/461), [#667](https://github.com/serbanghita/Mobile-Detect/issues/667) -* Some mobile devices (eg. IPadOS, Google Pixel Slate). See: [#795](https://github.com/serbanghita/Mobile-Detect/issues/795), [#788](https://github.com/serbanghita/Mobile-Detect/issues/788) -* Detecting the device brand (eg. Apple, Samsung, HTC) is not 100% reliable. -* We don't monitor the quality of the 3rd party tools based on Mobile Detect script. -We cannot guarantee that they are using the class properly or if they provide the latest version. -* Version `2.x` is made to be PHP 5.3 compatible because of the backward compatibility changes of PHP. -* There are hundreds of devices launched every month, we cannot keep a 100% up to date detection rate. -* The script cannot detect the viewport, pixel density or resolution of the screen since it's running server-side. diff --git a/app/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php b/app/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php deleted file mode 100644 index e2c72ae..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/export/exportToJSON.php +++ /dev/null @@ -1,67 +0,0 @@ - $detect->getScriptVersion(), - - // All headers that trigger 'isMobile' to be 'true', - // before reaching the User-Agent match detection. - 'headerMatch' => $detect->getMobileHeaders(), - - // All possible User-Agent headers. - 'uaHttpHeaders' => $detect->getUaHttpHeaders(), - - // All the regexes that trigger 'isMobile' or 'isTablet' - // to be true. - 'uaMatch' => array( - // If match is found, triggers 'isMobile' to be true. - 'phones' => $detect->getPhoneDevices(), - // Triggers 'isTablet' to be true. - 'tablets' => $detect->getTabletDevices(), - // If match is found, triggers 'isMobile' to be true. - 'browsers' => $detect->getBrowsers(), - // If match is found, triggers 'isMobile' to be true. - 'os' => $detect->getOperatingSystems(), - // Various utilities. To be further discussed. - 'utilities' => $detect->getUtilities() - ) -); - -$fileName = dirname(__FILE__).'/../Mobile_Detect.json'; -// Write the JSON file to disk.11 -// You can import this file in your app. -if (file_put_contents( - $fileName, - function_exists('json_format') ? json_format($json) : json_encode($json) -)) { - echo 'Done. Check '.realpath($fileName).' file.'; -} -else { - echo 'Failed to write '.realpath($fileName).' to disk.'; -} diff --git a/app/vendor/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php b/app/vendor/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php deleted file mode 100644 index ca7efec..0000000 --- a/app/vendor/mobiledetect/mobiledetectlib/namespaced/Detection/MobileDetect.php +++ /dev/null @@ -1,22 +0,0 @@ - - - The PSR-2 coding standard extended. - - - - - - - - - - error - - - - - - - \ No newline at end of file diff --git a/app/vendor/phpmailer/class.phpmailer.php b/app/vendor/phpmailer/class.phpmailer.php deleted file mode 100644 index 1b31ec1..0000000 --- a/app/vendor/phpmailer/class.phpmailer.php +++ /dev/null @@ -1,4039 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2012 - 2014 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. - */ - -/** - * PHPMailer - PHP email creation and transport class. - * @package PHPMailer - * @author Marcus Bointon (Synchro/coolbru) - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - */ -class PHPMailer -{ - /** - * The PHPMailer Version number. - * @var string - */ - public $Version = '5.2.23'; - - /** - * Email priority. - * Options: null (default), 1 = High, 3 = Normal, 5 = low. - * When null, the header is not set at all. - * @var integer - */ - public $Priority = null; - - /** - * The character set of the message. - * @var string - */ - public $CharSet = 'iso-8859-1'; - - /** - * The MIME Content-type of the message. - * @var string - */ - public $ContentType = 'text/plain'; - - /** - * The message encoding. - * Options: "8bit", "7bit", "binary", "base64", and "quoted-printable". - * @var string - */ - public $Encoding = '8bit'; - - /** - * Holds the most recent mailer error message. - * @var string - */ - public $ErrorInfo = ''; - - /** - * The From email address for the message. - * @var string - */ - public $From = 'root@localhost'; - - /** - * The From name of the message. - * @var string - */ - public $FromName = 'Root User'; - - /** - * The Sender email (Return-Path) of the message. - * If not empty, will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode. - * @var string - */ - public $Sender = ''; - - /** - * The Return-Path of the message. - * If empty, it will be set to either From or Sender. - * @var string - * @deprecated Email senders should never set a return-path header; - * it's the receiver's job (RFC5321 section 4.4), so this no longer does anything. - * @link https://tools.ietf.org/html/rfc5321#section-4.4 RFC5321 reference - */ - public $ReturnPath = ''; - - /** - * 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 events, use the bundled extras/EasyPeasyICS.php class or iCalcreator - * @link http://sprain.ch/blog/downloads/php-class-easypeasyics-create-ical-files-with-php/ - * @link http://kigkonsult.se/iCalcreator/ - * @var string - */ - public $Ical = ''; - - /** - * The complete compiled MIME message body. - * @access protected - * @var string - */ - protected $MIMEBody = ''; - - /** - * The complete compiled MIME message headers. - * @var string - * @access protected - */ - protected $MIMEHeader = ''; - - /** - * Extra headers that createHeader() doesn't fold in. - * @var string - * @access protected - */ - 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. - * @var integer - */ - 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 boolean - */ - public $UseSendmailOptions = true; - - /** - * Path to PHPMailer plugins. - * Useful if the SMTP class is not in the PHP include path. - * @var string - * @deprecated Should not be needed now there is an autoloader. - */ - public $PluginDir = ''; - - /** - * 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'. - * @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 integer - * @TODO Why is this needed when the SMTP class takes care of it? - */ - public $Port = 25; - - /** - * The SMTP HELO of the message. - * Default is $Hostname. If $Hostname is empty, PHPMailer attempts to find - * one with the same method described above for $Hostname. - * @var string - * @see PHPMailer::$Hostname - */ - public $Helo = ''; - - /** - * What kind of encryption to use on the SMTP connection. - * Options: '', 'ssl' or 'tls' - * @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 boolean - */ - public $SMTPAutoTLS = true; - - /** - * Whether to use SMTP authentication. - * Uses the Username and Password properties. - * @var boolean - * @see PHPMailer::$Username - * @see PHPMailer::$Password - */ - public $SMTPAuth = false; - - /** - * Options array passed to stream_context_create when connecting via SMTP. - * @var array - */ - public $SMTPOptions = array(); - - /** - * SMTP username. - * @var string - */ - public $Username = ''; - - /** - * SMTP password. - * @var string - */ - public $Password = ''; - - /** - * SMTP auth type. - * Options are CRAM-MD5, LOGIN, PLAIN, NTLM, XOAUTH2, attempted in that order if not specified - * @var string - */ - public $AuthType = ''; - - /** - * SMTP realm. - * Used for NTLM auth - * @var string - */ - public $Realm = ''; - - /** - * SMTP workstation. - * Used for NTLM auth - * @var string - */ - public $Workstation = ''; - - /** - * The SMTP server timeout in seconds. - * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 - * @var integer - */ - public $Timeout = 300; - - /** - * SMTP class debug output mode. - * Debug output level. - * Options: - * * `0` No output - * * `1` Commands - * * `2` Data and commands - * * `3` As 2 plus connection status - * * `4` Low-level data output - * @var integer - * @see SMTP::$do_debug - */ - 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 - * - * Alternatively, you can provide a callable expecting two params: a message string and the debug level: - * - * $mail->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; - * - * @var string|callable - * @see SMTP::$Debugoutput - */ - public $Debugoutput = 'echo'; - - /** - * Whether to keep SMTP connection open after each message. - * If this is set to true then to close the connection - * requires an explicit call to smtpClose(). - * @var boolean - */ - 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 boolean - */ - public $SingleTo = false; - - /** - * Storage for addresses when SingleTo is enabled. - * @var array - * @TODO This should really not be public - */ - public $SingleToArray = array(); - - /** - * Whether to generate VERP addresses on send. - * Only applicable when sending via SMTP. - * @link https://en.wikipedia.org/wiki/Variable_envelope_return_path - * @link http://www.postfix.org/VERP_README.html Postfix VERP info - * @var boolean - */ - public $do_verp = false; - - /** - * Whether to allow sending messages with an empty body. - * @var boolean - */ - public $AllowEmpty = false; - - /** - * The default line ending. - * @note The default remains "\n". We force CRLF where we know - * it must be used via self::CRLF. - * @var string - */ - public $LE = "\n"; - - /** - * 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 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: - * boolean $result result of the send action - * string $to email address of the recipient - * string $cc cc email addresses - * string $bcc bcc email addresses - * string $subject the subject - * string $body the email body - * string $from email address of sender - * @var string - */ - public $action_function = ''; - - /** - * What to put in the X-Mailer header. - * Options: An empty string for PHPMailer default, whitespace for none, or a string to use - * @var string - */ - 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. - * @see PHPMailer::validateAddress() - * @var string|callable - * @static - */ - public static $validator = 'auto'; - - /** - * An instance of the SMTP sender class. - * @var SMTP - * @access protected - */ - protected $smtp = null; - - /** - * The array of 'to' names and addresses. - * @var array - * @access protected - */ - protected $to = array(); - - /** - * The array of 'cc' names and addresses. - * @var array - * @access protected - */ - protected $cc = array(); - - /** - * The array of 'bcc' names and addresses. - * @var array - * @access protected - */ - protected $bcc = array(); - - /** - * The array of reply-to names and addresses. - * @var array - * @access protected - */ - protected $ReplyTo = array(); - - /** - * An array of all kinds of addresses. - * Includes all of $to, $cc, $bcc - * @var array - * @access protected - * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc - */ - protected $all_recipients = array(); - - /** - * 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. - * @var array - * @access protected - * @see PHPMailer::$to @see PHPMailer::$cc @see PHPMailer::$bcc - * @see PHPMailer::$all_recipients - */ - protected $RecipientsQueue = array(); - - /** - * 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. - * @var array - * @access protected - * @see PHPMailer::$ReplyTo - */ - protected $ReplyToQueue = array(); - - /** - * The array of attachments. - * @var array - * @access protected - */ - protected $attachment = array(); - - /** - * The array of custom headers. - * @var array - * @access protected - */ - protected $CustomHeader = array(); - - /** - * The most recent Message-ID (including angular brackets). - * @var string - * @access protected - */ - protected $lastMessageID = ''; - - /** - * The message's MIME type. - * @var string - * @access protected - */ - protected $message_type = ''; - - /** - * The array of MIME boundary strings. - * @var array - * @access protected - */ - protected $boundary = array(); - - /** - * The array of available languages. - * @var array - * @access protected - */ - protected $language = array(); - - /** - * The number of errors encountered. - * @var integer - * @access protected - */ - protected $error_count = 0; - - /** - * The S/MIME certificate file path. - * @var string - * @access protected - */ - protected $sign_cert_file = ''; - - /** - * The S/MIME key file path. - * @var string - * @access protected - */ - protected $sign_key_file = ''; - - /** - * The optional S/MIME extra certificates ("CA Chain") file path. - * @var string - * @access protected - */ - protected $sign_extracerts_file = ''; - - /** - * The S/MIME password for the key. - * Used only if the key is encrypted. - * @var string - * @access protected - */ - protected $sign_key_pass = ''; - - /** - * Whether to throw exceptions for errors. - * @var boolean - * @access protected - */ - protected $exceptions = false; - - /** - * Unique ID used for message ID and boundaries. - * @var string - * @access protected - */ - protected $uniqueid = ''; - - /** - * Error severity: message only, continue processing. - */ - const STOP_MESSAGE = 0; - - /** - * Error severity: message, likely ok to continue processing. - */ - const STOP_CONTINUE = 1; - - /** - * Error severity: message, plus full stop, critical error reached. - */ - const STOP_CRITICAL = 2; - - /** - * SMTP RFC standard line ending. - */ - const CRLF = "\r\n"; - - /** - * The maximum line length allowed by RFC 2822 section 2.1.1 - * @var integer - */ - const MAX_LINE_LENGTH = 998; - - /** - * Constructor. - * @param boolean $exceptions Should we throw external exceptions? - */ - public function __construct($exceptions = null) - { - if ($exceptions !== null) { - $this->exceptions = (boolean)$exceptions; - } - } - - /** - * 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 $params Params - * @access private - * @return boolean - */ - private function mailPassthru($to, $subject, $body, $header, $params) - { - //Check overloading of mail function to avoid double-encoding - if (ini_get('mbstring.func_overload') & 1) { - $subject = $this->secureHeader($subject); - } else { - $subject = $this->encodeHeader($this->secureHeader($subject)); - } - - //Can't use additional_parameters in safe_mode, calling mail() with null params breaks - //@link http://php.net/manual/en/function.mail.php - if (ini_get('safe_mode') or !$this->UseSendmailOptions or is_null($params)) { - $result = @mail($to, $subject, $body, $header); - } else { - $result = @mail($to, $subject, $body, $header, $params); - } - return $result; - } - /** - * Output debugging info via user-defined method. - * Only generates output if SMTP debug output is enabled (@see SMTP::$do_debug). - * @see PHPMailer::$Debugoutput - * @see PHPMailer::$SMTPDebug - * @param string $str - */ - protected function edebug($str) - { - if ($this->SMTPDebug <= 0) { - return; - } - //Avoid clash with built-in function names - if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) { - call_user_func($this->Debugoutput, $str, $this->SMTPDebug); - return; - } - switch ($this->Debugoutput) { - case 'error_log': - //Don't output, just log - 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?/ms', "\n", $str); - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( - "\n", - "\n \t ", - trim($str) - ) . "\n"; - } - } - - /** - * Sets message type to HTML or plain. - * @param boolean $isHtml True for HTML mode. - * @return void - */ - public function isHTML($isHtml = true) - { - if ($isHtml) { - $this->ContentType = 'text/html'; - } else { - $this->ContentType = 'text/plain'; - } - } - - /** - * Send messages using SMTP. - * @return void - */ - public function isSMTP() - { - $this->Mailer = 'smtp'; - } - - /** - * Send messages using PHP's mail() function. - * @return void - */ - public function isMail() - { - $this->Mailer = 'mail'; - } - - /** - * Send messages using $Sendmail. - * @return void - */ - public function isSendmail() - { - $ini_sendmail_path = ini_get('sendmail_path'); - - if (!stristr($ini_sendmail_path, 'sendmail')) { - $this->Sendmail = '/usr/sbin/sendmail'; - } else { - $this->Sendmail = $ini_sendmail_path; - } - $this->Mailer = 'sendmail'; - } - - /** - * Send messages using qmail. - * @return void - */ - public function isQmail() - { - $ini_sendmail_path = ini_get('sendmail_path'); - - if (!stristr($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 - * @return boolean 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. - * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. - * @param string $address The email address to send to - * @param string $name - * @return boolean 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. - * @note: This function works with the SMTP mailer on win32, not with the "mail" mailer. - * @param string $address The email address to send to - * @param string $name - * @return boolean 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 - * @return boolean 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 to send, resp. to reply to - * @param string $name - * @throws phpmailerException - * @return boolean true on success, false if address already used or invalid in some way - * @access protected - */ - protected function addOrEnqueueAnAddress($kind, $address, $name) - { - $address = trim($address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - if (($pos = strrpos($address, '@')) === false) { - // At-sign is misssing. - $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - $params = array($kind, $address, $name); - // Enqueue addresses with IDN until we know the PHPMailer::$CharSet. - if ($this->has8bitChars(substr($address, ++$pos)) and $this->idnSupported()) { - if ($kind != 'Reply-To') { - if (!array_key_exists($address, $this->RecipientsQueue)) { - $this->RecipientsQueue[$address] = $params; - return true; - } - } else { - if (!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(array($this, 'addAnAddress'), $params); - } - - /** - * 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 phpmailerException - * @return boolean true on success, false if address already used or invalid in some way - * @access protected - */ - protected function addAnAddress($kind, $address, $name = '') - { - if (!in_array($kind, array('to', 'cc', 'bcc', 'Reply-To'))) { - $error_message = $this->lang('Invalid recipient kind: ') . $kind; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - if (!$this->validateAddress($address)) { - $error_message = $this->lang('invalid_address') . " (addAnAddress $kind): $address"; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - if ($kind != 'Reply-To') { - if (!array_key_exists(strtolower($address), $this->all_recipients)) { - array_push($this->$kind, array($address, $name)); - $this->all_recipients[strtolower($address)] = true; - return true; - } - } else { - if (!array_key_exists(strtolower($address), $this->ReplyTo)) { - $this->ReplyTo[strtolower($address)] = array($address, $name); - return true; - } - } - return false; - } - - /** - * 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. - * @param string $addrstr The address list string - * @param bool $useimap Whether to use the IMAP extension to parse the list - * @return array - * @link http://www.andrew.cmu.edu/user/agreen1/testing/mrbs/web/Mail/RFC822.php A more careful implementation - */ - public function parseAddresses($addrstr, $useimap = true) - { - $addresses = array(); - if ($useimap and function_exists('imap_rfc822_parse_adrlist')) { - //Use this built-in parser if it's available - $list = imap_rfc822_parse_adrlist($addrstr, ''); - foreach ($list as $address) { - if ($address->host != '.SYNTAX-ERROR.') { - if ($this->validateAddress($address->mailbox . '@' . $address->host)) { - $addresses[] = array( - '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 ($this->validateAddress($address)) { - $addresses[] = array( - 'name' => '', - 'address' => $address - ); - } - } else { - list($name, $email) = explode('<', $address); - $email = trim(str_replace('>', '', $email)); - if ($this->validateAddress($email)) { - $addresses[] = array( - 'name' => trim(str_replace(array('"', "'"), '', $name)), - 'address' => $email - ); - } - } - } - } - return $addresses; - } - - /** - * Set the From and FromName properties. - * @param string $address - * @param string $name - * @param boolean $auto Whether to also set the Sender address, defaults to true - * @throws phpmailerException - * @return boolean - */ - public function setFrom($address, $name = '', $auto = true) - { - $address = trim($address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - // Don't validate now addresses with IDN. Will be done in send(). - if (($pos = strrpos($address, '@')) === false or - (!$this->has8bitChars(substr($address, ++$pos)) or !$this->idnSupported()) and - !$this->validateAddress($address)) { - $error_message = $this->lang('invalid_address') . " (setFrom) $address"; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - $this->From = $address; - $this->FromName = $name; - if ($auto) { - if (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. - * @param string $address The email address to check - * @param string|callable $patternselect A selector for the validation pattern to use : - * * `auto` Pick best pattern automatically; - * * `pcre8` Use the squiloople.com pattern, requires PCRE > 8.0, PHP >= 5.3.2, 5.2.14; - * * `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: - * 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. - * @return boolean - * @static - * @access public - */ - public static function validateAddress($address, $patternselect = null) - { - if (is_null($patternselect)) { - $patternselect = self::$validator; - } - if (is_callable($patternselect)) { - return call_user_func($patternselect, $address); - } - //Reject line breaks in addresses; it's valid RFC5322, but not RFC5321 - if (strpos($address, "\n") !== false or strpos($address, "\r") !== false) { - return false; - } - if (!$patternselect or $patternselect == 'auto') { - //Check this constant first so it works when extension_loaded() is disabled by safe mode - //Constant was added in PHP 5.2.4 - if (defined('PCRE_VERSION')) { - //This pattern can get stuck in a recursive loop in PCRE <= 8.0.2 - if (version_compare(PCRE_VERSION, '8.0.3') >= 0) { - $patternselect = 'pcre8'; - } else { - $patternselect = 'pcre'; - } - } elseif (function_exists('extension_loaded') and extension_loaded('pcre')) { - //Fall back to older PCRE - $patternselect = 'pcre'; - } else { - //Filter_var appeared in PHP 5.2.0 and does not require the PCRE extension - if (version_compare(PHP_VERSION, '5.2.0') >= 0) { - $patternselect = 'php'; - } else { - $patternselect = 'noregex'; - } - } - } - switch ($patternselect) { - case 'pcre8': - /** - * Uses the same RFC5322 regex on which FILTER_VALIDATE_EMAIL is based, but allows dotless domains. - * @link 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 (boolean)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 'pcre': - //An older regex that doesn't need a recent PCRE - return (boolean)preg_match( - '/^(?!(?>"?(?>\\\[ -~]|[^"])"?){255,})(?!(?>"?(?>\\\[ -~]|[^"])"?){65,}@)(?>' . - '[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*")' . - '(?>\.(?>[!#-\'*+\/-9=?^-~-]+|"(?>(?>[\x01-\x08\x0B\x0C\x0E-!#-\[\]-\x7F]|\\\[\x00-\xFF]))*"))*' . - '@(?>(?![a-z0-9-]{64,})(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)(?>\.(?![a-z0-9-]{64,})' . - '(?>[a-z0-9](?>[a-z0-9-]*[a-z0-9])?)){0,126}|\[(?:(?>IPv6:(?>(?>[a-f0-9]{1,4})(?>:' . - '[a-f0-9]{1,4}){7}|(?!(?:.*[a-f0-9][:\]]){8,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?' . - '::(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,6})?))|(?>(?>IPv6:(?>[a-f0-9]{1,4}(?>:' . - '[a-f0-9]{1,4}){5}:|(?!(?:.*[a-f0-9]:){6,})(?>[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4})?' . - '::(?>(?:[a-f0-9]{1,4}(?>:[a-f0-9]{1,4}){0,4}):)?))?(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}' . - '|[1-9]?[0-9])(?>\.(?>25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3}))\])$/isD', - $address - ); - case 'html5': - /** - * This is the pattern used in the HTML5 spec for validation of 'email' type form input elements. - * @link http://www.whatwg.org/specs/web-apps/current-work/#e-mail-state-(type=email) - */ - return (boolean)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 'noregex': - //No PCRE! Do something _very_ approximate! - //Check the address is 3 chars or longer and contains an @ that's not the first or last char - return (strlen($address) >= 3 - and strpos($address, '@') >= 1 - and strpos($address, '@') != strlen($address) - 1); - case 'php': - default: - return (boolean)filter_var($address, FILTER_VALIDATE_EMAIL); - } - } - - /** - * 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 function idnSupported() - { - // @TODO: Write our own "idn_to_ascii" function for PHP <= 5.2. - return function_exists('idn_to_ascii') and 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 has 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. - if ($this->idnSupported() and - !empty($this->CharSet) and - ($pos = strrpos($address, '@')) !== false) { - $domain = substr($address, ++$pos); - // Verify CharSet string is a valid one, and domain properly encoded in this CharSet. - if ($this->has8bitChars($domain) and @mb_check_encoding($domain, $this->CharSet)) { - $domain = mb_convert_encoding($domain, 'UTF-8', $this->CharSet); - if (($punycode = defined('INTL_IDNA_VARIANT_UTS46') ? - idn_to_ascii($domain, 0, INTL_IDNA_VARIANT_UTS46) : - idn_to_ascii($domain)) !== false) { - return substr($address, 0, $pos) . $punycode; - } - } - } - return $address; - } - - /** - * Create a message and send it. - * Uses the sending method specified by $Mailer. - * @throws phpmailerException - * @return boolean 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 (phpmailerException $exc) { - $this->mailHeader = ''; - $this->setError($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - return false; - } - } - - /** - * Prepare a message for sending. - * @throws phpmailerException - * @return boolean - */ - public function preSend() - { - 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(array($this, 'addAnAddress'), $params); - } - if ((count($this->to) + count($this->cc) + count($this->bcc)) < 1) { - throw new phpmailerException($this->lang('provide_address'), self::STOP_CRITICAL); - } - - // Validate From, Sender, and ConfirmReadingTo addresses - foreach (array('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 (!$this->validateAddress($this->$address_kind)) { - $error_message = $this->lang('invalid_address') . ' (punyEncode) ' . $this->$address_kind; - $this->setError($error_message); - $this->edebug($error_message); - if ($this->exceptions) { - throw new phpmailerException($error_message); - } - return false; - } - } - - // Set whether the message is multipart/alternative - if ($this->alternativeExists()) { - $this->ContentType = 'multipart/alternative'; - } - - $this->setMessageType(); - // Refuse to send an empty message unless we are specifically allowing it - if (!$this->AllowEmpty and empty($this->Body)) { - throw new phpmailerException($this->lang('empty_message'), self::STOP_CRITICAL); - } - - // 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 ($this->Mailer == 'mail') { - 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(trim($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) && file_exists($this->DKIM_private)) - ) - ) { - $header_dkim = $this->DKIM_Add( - $this->MIMEHeader . $this->mailHeader, - $this->encodeHeader($this->secureHeader($this->Subject)), - $this->MIMEBody - ); - $this->MIMEHeader = rtrim($this->MIMEHeader, "\r\n ") . self::CRLF . - str_replace("\r\n", "\n", $header_dkim) . self::CRLF; - } - return true; - } catch (phpmailerException $exc) { - $this->setError($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - return false; - } - } - - /** - * Actually send a message. - * Send the email via the selected mechanism - * @throws phpmailerException - * @return boolean - */ - 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 (phpmailerException $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - } - return false; - } - - /** - * Send mail using the $Sendmail program. - * @param string $header The message headers - * @param string $body The message body - * @see PHPMailer::$Sendmail - * @throws phpmailerException - * @access protected - * @return boolean - */ - protected function sendmailSend($header, $body) - { - // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (!empty($this->Sender) and self::isShellSafe($this->Sender)) { - if ($this->Mailer == 'qmail') { - $sendmailFmt = '%s -f%s'; - } else { - $sendmailFmt = '%s -oi -f%s -t'; - } - } else { - if ($this->Mailer == 'qmail') { - $sendmailFmt = '%s'; - } else { - $sendmailFmt = '%s -oi -t'; - } - } - - // TODO: If possible, this should be changed to escapeshellarg. Needs thorough testing. - $sendmail = sprintf($sendmailFmt, escapeshellcmd($this->Sendmail), $this->Sender); - - if ($this->SingleTo) { - foreach ($this->SingleToArray as $toAddr) { - if (!@$mail = popen($sendmail, 'w')) { - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - fputs($mail, 'To: ' . $toAddr . "\n"); - fputs($mail, $header); - fputs($mail, $body); - $result = pclose($mail); - $this->doCallback( - ($result == 0), - array($toAddr), - $this->cc, - $this->bcc, - $this->Subject, - $body, - $this->From - ); - if ($result != 0) { - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - } - } else { - if (!@$mail = popen($sendmail, 'w')) { - throw new phpmailerException($this->lang('execute') . $this->Sendmail, self::STOP_CRITICAL); - } - fputs($mail, $header); - fputs($mail, $body); - $result = pclose($mail); - $this->doCallback( - ($result == 0), - $this->to, - $this->cc, - $this->bcc, - $this->Subject, - $body, - $this->From - ); - if ($result != 0) { - throw new phpmailerException($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. - * @param string $string The string to be validated - * @see https://github.com/PHPMailer/PHPMailer/issues/924 CVE-2016-10045 bug report - * @access protected - * @return boolean - */ - protected static function isShellSafe($string) - { - // Future-proof - if (escapeshellcmd($string) !== $string - or !in_array(escapeshellarg($string), array("'$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; - } - - /** - * Send mail using the PHP mail() function. - * @param string $header The message headers - * @param string $body The message body - * @link http://www.php.net/manual/en/book.mail.php - * @throws phpmailerException - * @access protected - * @return boolean - */ - protected function mailSend($header, $body) - { - $toArr = array(); - foreach ($this->to as $toaddr) { - $toArr[] = $this->addrFormat($toaddr); - } - $to = implode(', ', $toArr); - - $params = null; - //This sets the SMTP envelope sender which gets turned into a return-path header by the receiver - if (!empty($this->Sender) and $this->validateAddress($this->Sender)) { - // CVE-2016-10033, CVE-2016-10045: Don't pass -f if characters will be escaped. - if (self::isShellSafe($this->Sender)) { - $params = sprintf('-f%s', $this->Sender); - } - } - if (!empty($this->Sender) and !ini_get('safe_mode') and $this->validateAddress($this->Sender)) { - $old_from = ini_get('sendmail_from'); - ini_set('sendmail_from', $this->Sender); - } - $result = false; - if ($this->SingleTo and count($toArr) > 1) { - foreach ($toArr as $toAddr) { - $result = $this->mailPassthru($toAddr, $this->Subject, $body, $header, $params); - $this->doCallback($result, array($toAddr), $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 phpmailerException($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 - * @return SMTP - */ - public function getSMTPInstance() - { - if (!is_object($this->smtp)) { - $this->smtp = new SMTP; - } - return $this->smtp; - } - - /** - * Send mail via SMTP. - * Returns false if there is a bad MAIL FROM, RCPT, or DATA input. - * Uses the PHPMailerSMTP class by default. - * @see PHPMailer::getSMTPInstance() to use a different class. - * @param string $header The message headers - * @param string $body The message body - * @throws phpmailerException - * @uses SMTP - * @access protected - * @return boolean - */ - protected function smtpSend($header, $body) - { - $bad_rcpt = array(); - if (!$this->smtpConnect($this->SMTPOptions)) { - throw new phpmailerException($this->lang('smtp_connect_failed'), self::STOP_CRITICAL); - } - if (!empty($this->Sender) and $this->validateAddress($this->Sender)) { - $smtp_from = $this->Sender; - } else { - $smtp_from = $this->From; - } - if (!$this->smtp->mail($smtp_from)) { - $this->setError($this->lang('from_failed') . $smtp_from . ' : ' . implode(',', $this->smtp->getError())); - throw new phpmailerException($this->ErrorInfo, self::STOP_CRITICAL); - } - - // Attempt to send to all recipients - foreach (array($this->to, $this->cc, $this->bcc) as $togroup) { - foreach ($togroup as $to) { - if (!$this->smtp->recipient($to[0])) { - $error = $this->smtp->getError(); - $bad_rcpt[] = array('to' => $to[0], 'error' => $error['detail']); - $isSent = false; - } else { - $isSent = true; - } - $this->doCallback($isSent, array($to[0]), array(), array(), $this->Subject, $body, $this->From); - } - } - - // Only send the DATA command if we have viable recipients - if ((count($this->all_recipients) > count($bad_rcpt)) and !$this->smtp->data($header . $body)) { - throw new phpmailerException($this->lang('data_not_accepted'), self::STOP_CRITICAL); - } - if ($this->SMTPKeepAlive) { - $this->smtp->reset(); - } else { - $this->smtp->quit(); - $this->smtp->close(); - } - //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 phpmailerException( - $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() - * @uses SMTP - * @access public - * @throws phpmailerException - * @return boolean - */ - public function smtpConnect($options = null) - { - if (is_null($this->smtp)) { - $this->smtp = $this->getSMTPInstance(); - } - - //If no options are provided, use whatever is set in the instance - if (is_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); - $hosts = explode(';', $this->Host); - $lastexception = null; - - foreach ($hosts as $hostentry) { - $hostinfo = array(); - if (!preg_match('/^((ssl|tls):\/\/)*([a-zA-Z0-9\.-]*):?([0-9]*)$/', trim($hostentry), $hostinfo)) { - // Not a valid host entry - continue; - } - // $hostinfo[2]: optional ssl or tls prefix - // $hostinfo[3]: the hostname - // $hostinfo[4]: 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 - $prefix = ''; - $secure = $this->SMTPSecure; - $tls = ($this->SMTPSecure == 'tls'); - if ('ssl' == $hostinfo[2] or ('' == $hostinfo[2] and 'ssl' == $this->SMTPSecure)) { - $prefix = 'ssl://'; - $tls = false; // Can't have SSL and TLS at the same time - $secure = 'ssl'; - } elseif ($hostinfo[2] == 'tls') { - $tls = true; - // tls doesn't use a prefix - $secure = 'tls'; - } - //Do we need the OpenSSL extension? - $sslext = defined('OPENSSL_ALGO_SHA1'); - if ('tls' === $secure or 'ssl' === $secure) { - //Check for an OpenSSL constant rather than using extension_loaded, which is sometimes disabled - if (!$sslext) { - throw new phpmailerException($this->lang('extension_missing').'openssl', self::STOP_CRITICAL); - } - } - $host = $hostinfo[3]; - $port = $this->Port; - $tport = (integer)$hostinfo[4]; - if ($tport > 0 and $tport < 65536) { - $port = $tport; - } - 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 and $sslext and $secure != 'ssl' and $this->smtp->getServerExt('STARTTLS')) { - $tls = true; - } - if ($tls) { - if (!$this->smtp->startTLS()) { - throw new phpmailerException($this->lang('connect_host')); - } - // We must resend EHLO after TLS negotiation - $this->smtp->hello($hello); - } - if ($this->SMTPAuth) { - if (!$this->smtp->authenticate( - $this->Username, - $this->Password, - $this->AuthType, - $this->Realm, - $this->Workstation - ) - ) { - throw new phpmailerException($this->lang('authenticate')); - } - } - return true; - } catch (phpmailerException $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 and !is_null($lastexception)) { - throw $lastexception; - } - return false; - } - - /** - * Close the active SMTP session if one exists. - * @return void - */ - public function smtpClose() - { - if (is_a($this->smtp, 'SMTP')) { - if ($this->smtp->connected()) { - $this->smtp->quit(); - $this->smtp->close(); - } - } - } - - /** - * Set the language for error messages. - * Returns false if it cannot load the language file. - * The default language is English. - * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") - * @param string $lang_path Path to the language file directory, with trailing separator (slash) - * @return boolean - * @access public - */ - public function setLanguage($langcode = 'en', $lang_path = '') - { - // Backwards compatibility for renamed language codes - $renamed_langcodes = array( - 'br' => 'pt_br', - 'cz' => 'cs', - 'dk' => 'da', - 'no' => 'nb', - 'se' => 'sv', - ); - - if (isset($renamed_langcodes[$langcode])) { - $langcode = $renamed_langcodes[$langcode]; - } - - // Define full set of translatable strings in English - $PHPMAILER_LANG = array( - 'authenticate' => 'SMTP Error: Could not authenticate.', - '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: ', - '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: ', - '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_connect_failed' => 'SMTP connect() failed.', - 'smtp_error' => 'SMTP server error: ', - 'variable_set' => 'Cannot set or reset variable: ', - 'extension_missing' => 'Extension missing: ' - ); - if (empty($lang_path)) { - // Calculate an absolute path so it can work if CWD is not here - $lang_path = dirname(__FILE__). DIRECTORY_SEPARATOR . 'language'. DIRECTORY_SEPARATOR; - } - //Validate $langcode - if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { - $langcode = 'en'; - } - $foundlang = true; - $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; - // There is no English translation file - if ($langcode != 'en') { - // Make sure language file path is readable - if (!is_readable($lang_file)) { - $foundlang = false; - } else { - // Overwrite language-specific strings. - // This way we'll never have missing translation keys. - $foundlang = include $lang_file; - } - } - $this->language = $PHPMAILER_LANG; - return (boolean)$foundlang; // Returns false if language not found - } - - /** - * Get the array of strings for the current language. - * @return array - */ - public function getTranslations() - { - return $this->language; - } - - /** - * Create recipient headers. - * @access public - * @param string $type - * @param array $addr An array of recipient, - * where each recipient is a 2-element indexed array with element 0 containing an address - * and element 1 containing a name, like: - * array(array('joe@example.com', 'Joe User'), array('zoe@example.com', 'Zoe User')) - * @return string - */ - public function addrAppend($type, $addr) - { - $addresses = array(); - foreach ($addr as $address) { - $addresses[] = $this->addrFormat($address); - } - return $type . ': ' . implode(', ', $addresses) . $this->LE; - } - - /** - * Format an address for use in a message header. - * @access public - * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name - * like array('joe@example.com', 'Joe User') - * @return string - */ - public function addrFormat($addr) - { - if (empty($addr[1])) { // No name provided - return $this->secureHeader($addr[0]); - } else { - return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . ' <' . $this->secureHeader( - $addr[0] - ) . '>'; - } - } - - /** - * Word-wrap message. - * For use with mailers that do not automatically perform wrapping - * and for quoted-printable encoded messages. - * Original written by philippe. - * @param string $message The message to wrap - * @param integer $length The line length to wrap to - * @param boolean $qp_mode Whether to run in Quoted-Printable mode - * @access public - * @return string - */ - public function wrapText($message, $length, $qp_mode = false) - { - if ($qp_mode) { - $soft_break = sprintf(' =%s', $this->LE); - } else { - $soft_break = $this->LE; - } - // If utf-8 encoding is used, we will need to make sure we don't - // split multibyte characters when we wrap - $is_utf8 = (strtolower($this->CharSet) == 'utf-8'); - $lelen = strlen($this->LE); - $crlflen = strlen(self::CRLF); - - $message = $this->fixEOL($message); - //Remove a trailing line break - if (substr($message, -$lelen) == $this->LE) { - $message = substr($message, 0, -$lelen); - } - - //Split message into lines - $lines = explode($this->LE, $message); - //Message will be rebuilt in here - $message = ''; - foreach ($lines as $line) { - $words = explode(' ', $line); - $buf = ''; - $firstword = true; - foreach ($words as $word) { - if ($qp_mode and (strlen($word) > $length)) { - $space_left = $length - strlen($buf) - $crlflen; - if (!$firstword) { - if ($space_left > 20) { - $len = $space_left; - if ($is_utf8) { - $len = $this->utf8CharBoundary($word, $len); - } elseif (substr($word, $len - 1, 1) == '=') { - $len--; - } elseif (substr($word, $len - 2, 1) == '=') { - $len -= 2; - } - $part = substr($word, 0, $len); - $word = substr($word, $len); - $buf .= ' ' . $part; - $message .= $buf . sprintf('=%s', self::CRLF); - } else { - $message .= $buf . $soft_break; - } - $buf = ''; - } - while (strlen($word) > 0) { - if ($length <= 0) { - break; - } - $len = $length; - if ($is_utf8) { - $len = $this->utf8CharBoundary($word, $len); - } elseif (substr($word, $len - 1, 1) == '=') { - $len--; - } elseif (substr($word, $len - 2, 1) == '=') { - $len -= 2; - } - $part = substr($word, 0, $len); - $word = substr($word, $len); - - if (strlen($word) > 0) { - $message .= $part . sprintf('=%s', self::CRLF); - } else { - $buf = $part; - } - } - } else { - $buf_o = $buf; - if (!$firstword) { - $buf .= ' '; - } - $buf .= $word; - - if (strlen($buf) > $length and $buf_o != '') { - $message .= $buf_o . $soft_break; - $buf = $word; - } - } - $firstword = false; - } - $message .= $buf . self::CRLF; - } - - return $message; - } - - /** - * Find the last character boundary prior to $maxLength in a utf-8 - * quoted-printable encoded string. - * Original written by Colin Brown. - * @access public - * @param string $encodedText utf-8 QP text - * @param integer $maxLength Find the last character boundary prior to this length - * @return integer - */ - public function utf8CharBoundary($encodedText, $maxLength) - { - $foundSplitPos = false; - $lookBack = 3; - while (!$foundSplitPos) { - $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); - $encodedCharPos = strpos($lastChunk, '='); - if (false !== $encodedCharPos) { - // Found start of encoded character byte within $lookBack block. - // Check the encoded byte value (the 2 chars after the '=') - $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); - $dec = hexdec($hex); - if ($dec < 128) { - // Single byte character. - // If the encoded char was found at pos 0, it will fit - // otherwise reduce maxLength to start of the encoded char - if ($encodedCharPos > 0) { - $maxLength = $maxLength - ($lookBack - $encodedCharPos); - } - $foundSplitPos = true; - } elseif ($dec >= 192) { - // First byte of a multi byte character - // Reduce maxLength to split at start of character - $maxLength = $maxLength - ($lookBack - $encodedCharPos); - $foundSplitPos = true; - } elseif ($dec < 192) { - // Middle byte of a multi byte character, look further back - $lookBack += 3; - } - } else { - // No encoded character found - $foundSplitPos = true; - } - } - return $maxLength; - } - - /** - * Apply word wrapping to the message body. - * Wraps the message body to the number of chars set in the WordWrap property. - * You should only do this to plain-text bodies as wrapping HTML tags may break them. - * This is called automatically by createBody(), so you don't need to call it yourself. - * @access public - * @return void - */ - public function setWordWrap() - { - if ($this->WordWrap < 1) { - return; - } - - switch ($this->message_type) { - case 'alt': - case 'alt_inline': - case 'alt_attach': - case 'alt_inline_attach': - $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); - break; - default: - $this->Body = $this->wrapText($this->Body, $this->WordWrap); - break; - } - } - - /** - * Assemble message headers. - * @access public - * @return string The assembled headers - */ - public function createHeader() - { - $result = ''; - - if ($this->MessageDate == '') { - $this->MessageDate = self::rfcDate(); - } - $result .= $this->headerLine('Date', $this->MessageDate); - - // To be created automatically by mail() - if ($this->SingleTo) { - if ($this->Mailer != 'mail') { - foreach ($this->to as $toaddr) { - $this->SingleToArray[] = $this->addrFormat($toaddr); - } - } - } else { - if (count($this->to) > 0) { - if ($this->Mailer != 'mail') { - $result .= $this->addrAppend('To', $this->to); - } - } elseif (count($this->cc) == 0) { - $result .= $this->headerLine('To', 'undisclosed-recipients:;'); - } - } - - $result .= $this->addrAppend('From', array(array(trim($this->From), $this->FromName))); - - // sendmail and mail() extract Cc from the header before sending - if (count($this->cc) > 0) { - $result .= $this->addrAppend('Cc', $this->cc); - } - - // sendmail and mail() extract Bcc from the header before sending - if (( - $this->Mailer == 'sendmail' or $this->Mailer == 'qmail' or $this->Mailer == 'mail' - ) - and count($this->bcc) > 0 - ) { - $result .= $this->addrAppend('Bcc', $this->bcc); - } - - if (count($this->ReplyTo) > 0) { - $result .= $this->addrAppend('Reply-To', $this->ReplyTo); - } - - // mail() sets the subject itself - if ($this->Mailer != 'mail') { - $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); - } - - // Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 - // https://tools.ietf.org/html/rfc5322#section-3.6.4 - if ('' != $this->MessageID and preg_match('/^<.*@.*>$/', $this->MessageID)) { - $this->lastMessageID = $this->MessageID; - } else { - $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); - } - $result .= $this->headerLine('Message-ID', $this->lastMessageID); - if (!is_null($this->Priority)) { - $result .= $this->headerLine('X-Priority', $this->Priority); - } - if ($this->XMailer == '') { - $result .= $this->headerLine( - 'X-Mailer', - 'PHPMailer ' . $this->Version . ' (https://github.com/PHPMailer/PHPMailer)' - ); - } else { - $myXmailer = trim($this->XMailer); - if ($myXmailer) { - $result .= $this->headerLine('X-Mailer', $myXmailer); - } - } - - if ($this->ConfirmReadingTo != '') { - $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); - } - - // Add custom headers - foreach ($this->CustomHeader as $header) { - $result .= $this->headerLine( - trim($header[0]), - $this->encodeHeader(trim($header[1])) - ); - } - if (!$this->sign_key_file) { - $result .= $this->headerLine('MIME-Version', '1.0'); - $result .= $this->getMailMIME(); - } - - return $result; - } - - /** - * Get the message MIME type headers. - * @access public - * @return string - */ - public function getMailMIME() - { - $result = ''; - $ismultipart = true; - switch ($this->message_type) { - case 'inline': - $result .= $this->headerLine('Content-Type', 'multipart/related;'); - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); - break; - case 'attach': - case 'inline_attach': - case 'alt_attach': - case 'alt_inline_attach': - $result .= $this->headerLine('Content-Type', 'multipart/mixed;'); - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); - break; - case 'alt': - case 'alt_inline': - $result .= $this->headerLine('Content-Type', 'multipart/alternative;'); - $result .= $this->textLine("\tboundary=\"" . $this->boundary[1] . '"'); - break; - default: - // Catches case 'plain': and case '': - $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); - $ismultipart = false; - break; - } - // RFC1341 part 5 says 7bit is assumed if not specified - if ($this->Encoding != '7bit') { - // RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE - if ($ismultipart) { - if ($this->Encoding == '8bit') { - $result .= $this->headerLine('Content-Transfer-Encoding', '8bit'); - } - // The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible - } else { - $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); - } - } - - if ($this->Mailer != 'mail') { - $result .= $this->LE; - } - - return $result; - } - - /** - * Returns the whole MIME message. - * Includes complete headers and body. - * Only valid post preSend(). - * @see PHPMailer::preSend() - * @access public - * @return string - */ - public function getSentMIMEMessage() - { - return rtrim($this->MIMEHeader . $this->mailHeader, "\n\r") . self::CRLF . self::CRLF . $this->MIMEBody; - } - - /** - * Create unique ID - * @return string - */ - protected function generateId() { - return md5(uniqid(time())); - } - - /** - * Assemble the message body. - * Returns an empty string on failure. - * @access public - * @throws phpmailerException - * @return string The assembled message body - */ - public function createBody() - { - $body = ''; - //Create unique IDs and preset boundaries - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1_' . $this->uniqueid; - $this->boundary[2] = 'b2_' . $this->uniqueid; - $this->boundary[3] = 'b3_' . $this->uniqueid; - - if ($this->sign_key_file) { - $body .= $this->getMailMIME() . $this->LE; - } - - $this->setWordWrap(); - - $bodyEncoding = $this->Encoding; - $bodyCharSet = $this->CharSet; - //Can we do a 7-bit downgrade? - if ($bodyEncoding == '8bit' and !$this->has8bitChars($this->Body)) { - $bodyEncoding = '7bit'; - //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit - $bodyCharSet = 'us-ascii'; - } - //If lines are too long, and we're not already using an encoding that will shorten them, - //change to quoted-printable transfer encoding for the body part only - if ('base64' != $this->Encoding and self::hasLineLongerThanMax($this->Body)) { - $bodyEncoding = 'quoted-printable'; - } - - $altBodyEncoding = $this->Encoding; - $altBodyCharSet = $this->CharSet; - //Can we do a 7-bit downgrade? - if ($altBodyEncoding == '8bit' and !$this->has8bitChars($this->AltBody)) { - $altBodyEncoding = '7bit'; - //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit - $altBodyCharSet = 'us-ascii'; - } - //If lines are too long, and we're not already using an encoding that will shorten them, - //change to quoted-printable transfer encoding for the alt body part only - if ('base64' != $altBodyEncoding and self::hasLineLongerThanMax($this->AltBody)) { - $altBodyEncoding = 'quoted-printable'; - } - //Use this as a preamble in all multipart message types - $mimepre = "This is a multi-part message in MIME format." . $this->LE . $this->LE; - switch ($this->message_type) { - case 'inline': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[1]); - break; - case 'attach': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'inline_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/related;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[2]); - $body .= $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'alt': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - if (!empty($this->Ical)) { - $body .= $this->getBoundary($this->boundary[1], '', 'text/calendar; method=REQUEST', ''); - $body .= $this->encodeString($this->Ical, $this->Encoding); - $body .= $this->LE . $this->LE; - } - $body .= $this->endBoundary($this->boundary[1]); - break; - case 'alt_inline': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/related;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[2]); - $body .= $this->LE; - $body .= $this->endBoundary($this->boundary[1]); - break; - case 'alt_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->endBoundary($this->boundary[2]); - $body .= $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'alt_inline_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', 'multipart/alternative;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[2] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[2], $altBodyCharSet, 'text/plain', $altBodyEncoding); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->textLine('--' . $this->boundary[2]); - $body .= $this->headerLine('Content-Type', 'multipart/related;'); - $body .= $this->textLine("\tboundary=\"" . $this->boundary[3] . '"'); - $body .= $this->LE; - $body .= $this->getBoundary($this->boundary[3], $bodyCharSet, 'text/html', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= $this->LE . $this->LE; - $body .= $this->attachAll('inline', $this->boundary[3]); - $body .= $this->LE; - $body .= $this->endBoundary($this->boundary[2]); - $body .= $this->LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - default: - // Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types - //Reset the `Encoding` property in case we changed it for line length reasons - $this->Encoding = $bodyEncoding; - $body .= $this->encodeString($this->Body, $this->Encoding); - break; - } - - if ($this->isError()) { - $body = ''; - } elseif ($this->sign_key_file) { - try { - if (!defined('PKCS7_TEXT')) { - throw new phpmailerException($this->lang('extension_missing') . 'openssl'); - } - // @TODO would be nice to use php://temp streams here, but need to wrap for PHP < 5.1 - $file = tempnam(sys_get_temp_dir(), 'mail'); - if (false === file_put_contents($file, $body)) { - throw new phpmailerException($this->lang('signing') . ' Could not write temp file'); - } - $signed = tempnam(sys_get_temp_dir(), 'signed'); - //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 - if (empty($this->sign_extracerts_file)) { - $sign = @openssl_pkcs7_sign( - $file, - $signed, - 'file://' . realpath($this->sign_cert_file), - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), - null - ); - } else { - $sign = @openssl_pkcs7_sign( - $file, - $signed, - 'file://' . realpath($this->sign_cert_file), - array('file://' . realpath($this->sign_key_file), $this->sign_key_pass), - null, - PKCS7_DETACHED, - $this->sign_extracerts_file - ); - } - if ($sign) { - @unlink($file); - $body = file_get_contents($signed); - @unlink($signed); - //The message returned by openssl contains both headers and body, so need to split them up - $parts = explode("\n\n", $body, 2); - $this->MIMEHeader .= $parts[0] . $this->LE . $this->LE; - $body = $parts[1]; - } else { - @unlink($file); - @unlink($signed); - throw new phpmailerException($this->lang('signing') . openssl_error_string()); - } - } catch (phpmailerException $exc) { - $body = ''; - if ($this->exceptions) { - throw $exc; - } - } - } - return $body; - } - - /** - * Return the start of a message boundary. - * @access protected - * @param string $boundary - * @param string $charSet - * @param string $contentType - * @param string $encoding - * @return string - */ - protected function getBoundary($boundary, $charSet, $contentType, $encoding) - { - $result = ''; - if ($charSet == '') { - $charSet = $this->CharSet; - } - if ($contentType == '') { - $contentType = $this->ContentType; - } - if ($encoding == '') { - $encoding = $this->Encoding; - } - $result .= $this->textLine('--' . $boundary); - $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); - $result .= $this->LE; - // RFC1341 part 5 says 7bit is assumed if not specified - if ($encoding != '7bit') { - $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); - } - $result .= $this->LE; - - return $result; - } - - /** - * Return the end of a message boundary. - * @access protected - * @param string $boundary - * @return string - */ - protected function endBoundary($boundary) - { - return $this->LE . '--' . $boundary . '--' . $this->LE; - } - - /** - * Set the message type. - * PHPMailer only supports some preset message types, not arbitrary MIME structures. - * @access protected - * @return void - */ - protected function setMessageType() - { - $type = array(); - if ($this->alternativeExists()) { - $type[] = 'alt'; - } - if ($this->inlineImageExists()) { - $type[] = 'inline'; - } - if ($this->attachmentExists()) { - $type[] = 'attach'; - } - $this->message_type = implode('_', $type); - if ($this->message_type == '') { - //The 'plain' message_type refers to the message having a single body element, not that it is plain-text - $this->message_type = 'plain'; - } - } - - /** - * Format a header line. - * @access public - * @param string $name - * @param string $value - * @return string - */ - public function headerLine($name, $value) - { - return $name . ': ' . $value . $this->LE; - } - - /** - * Return a formatted mail line. - * @access public - * @param string $value - * @return string - */ - public function textLine($value) - { - return $value . $this->LE; - } - - /** - * Add an attachment from a path on the filesystem. - * Never use a user-supplied path to a file! - * Returns false if the file could not be found or read. - * @param string $path Path to the attachment. - * @param string $name Overrides the attachment name. - * @param string $encoding File encoding (see $Encoding). - * @param string $type File extension (MIME) type. - * @param string $disposition Disposition to use - * @throws phpmailerException - * @return boolean - */ - public function addAttachment($path, $name = '', $encoding = 'base64', $type = '', $disposition = 'attachment') - { - try { - if (!@is_file($path)) { - throw new phpmailerException($this->lang('file_access') . $path, self::STOP_CONTINUE); - } - - // If a MIME type is not specified, try to work it out from the file name - if ($type == '') { - $type = self::filenameToType($path); - } - - $filename = basename($path); - if ($name == '') { - $name = $filename; - } - - $this->attachment[] = array( - 0 => $path, - 1 => $filename, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => false, // isStringAttachment - 6 => $disposition, - 7 => 0 - ); - - } catch (phpmailerException $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - return false; - } - return true; - } - - /** - * Return the array of attachments. - * @return array - */ - public function getAttachments() - { - return $this->attachment; - } - - /** - * Attach all file, string, and binary attachments to the message. - * Returns an empty string on failure. - * @access protected - * @param string $disposition_type - * @param string $boundary - * @return string - */ - protected function attachAll($disposition_type, $boundary) - { - // Return text of body - $mime = array(); - $cidUniq = array(); - $incl = array(); - - // Add all attachments - foreach ($this->attachment as $attachment) { - // Check if it is a valid disposition_filter - if ($attachment[6] == $disposition_type) { - // Check for string attachment - $string = ''; - $path = ''; - $bString = $attachment[5]; - if ($bString) { - $string = $attachment[0]; - } else { - $path = $attachment[0]; - } - - $inclhash = md5(serialize($attachment)); - if (in_array($inclhash, $incl)) { - continue; - } - $incl[] = $inclhash; - $name = $attachment[2]; - $encoding = $attachment[3]; - $type = $attachment[4]; - $disposition = $attachment[6]; - $cid = $attachment[7]; - if ($disposition == 'inline' && array_key_exists($cid, $cidUniq)) { - continue; - } - $cidUniq[$cid] = true; - - $mime[] = sprintf('--%s%s', $boundary, $this->LE); - //Only include a filename property if we have one - if (!empty($name)) { - $mime[] = sprintf( - 'Content-Type: %s; name="%s"%s', - $type, - $this->encodeHeader($this->secureHeader($name)), - $this->LE - ); - } else { - $mime[] = sprintf( - 'Content-Type: %s%s', - $type, - $this->LE - ); - } - // RFC1341 part 5 says 7bit is assumed if not specified - if ($encoding != '7bit') { - $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, $this->LE); - } - - if ($disposition == 'inline') { - $mime[] = sprintf('Content-ID: <%s>%s', $cid, $this->LE); - } - - // If a filename contains any of these chars, it should be quoted, - // but not otherwise: RFC2183 & RFC2045 5.1 - // Fixes a warning in IETF's msglint MIME checker - // Allow for bypassing the Content-Disposition header totally - if (!(empty($disposition))) { - $encoded_name = $this->encodeHeader($this->secureHeader($name)); - if (preg_match('/[ \(\)<>@,;:\\"\/\[\]\?=]/', $encoded_name)) { - $mime[] = sprintf( - 'Content-Disposition: %s; filename="%s"%s', - $disposition, - $encoded_name, - $this->LE . $this->LE - ); - } else { - if (!empty($encoded_name)) { - $mime[] = sprintf( - 'Content-Disposition: %s; filename=%s%s', - $disposition, - $encoded_name, - $this->LE . $this->LE - ); - } else { - $mime[] = sprintf( - 'Content-Disposition: %s%s', - $disposition, - $this->LE . $this->LE - ); - } - } - } else { - $mime[] = $this->LE; - } - - // Encode as string attachment - if ($bString) { - $mime[] = $this->encodeString($string, $encoding); - if ($this->isError()) { - return ''; - } - $mime[] = $this->LE . $this->LE; - } else { - $mime[] = $this->encodeFile($path, $encoding); - if ($this->isError()) { - return ''; - } - $mime[] = $this->LE . $this->LE; - } - } - } - - $mime[] = sprintf('--%s--%s', $boundary, $this->LE); - - return implode('', $mime); - } - - /** - * Encode a file attachment in requested format. - * Returns an empty string on failure. - * @param string $path The full path to the file - * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' - * @throws phpmailerException - * @access protected - * @return string - */ - protected function encodeFile($path, $encoding = 'base64') - { - try { - if (!is_readable($path)) { - throw new phpmailerException($this->lang('file_open') . $path, self::STOP_CONTINUE); - } - $magic_quotes = get_magic_quotes_runtime(); - if ($magic_quotes) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime(false); - } else { - //Doesn't exist in PHP 5.4, but we don't need to check because - //get_magic_quotes_runtime always returns false in 5.4+ - //so it will never get here - ini_set('magic_quotes_runtime', false); - } - } - $file_buffer = file_get_contents($path); - $file_buffer = $this->encodeString($file_buffer, $encoding); - if ($magic_quotes) { - if (version_compare(PHP_VERSION, '5.3.0', '<')) { - set_magic_quotes_runtime($magic_quotes); - } else { - ini_set('magic_quotes_runtime', $magic_quotes); - } - } - return $file_buffer; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - return ''; - } - } - - /** - * Encode a string in requested format. - * Returns an empty string on failure. - * @param string $str The text to encode - * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' - * @access public - * @return string - */ - public function encodeString($str, $encoding = 'base64') - { - $encoded = ''; - switch (strtolower($encoding)) { - case 'base64': - $encoded = chunk_split(base64_encode($str), 76, $this->LE); - break; - case '7bit': - case '8bit': - $encoded = $this->fixEOL($str); - // Make sure it ends with a line break - if (substr($encoded, -(strlen($this->LE))) != $this->LE) { - $encoded .= $this->LE; - } - break; - case 'binary': - $encoded = $str; - break; - case 'quoted-printable': - $encoded = $this->encodeQP($str); - break; - default: - $this->setError($this->lang('encoding') . $encoding); - break; - } - return $encoded; - } - - /** - * Encode a header string optimally. - * Picks shortest of Q, B, quoted-printable or none. - * @access public - * @param string $str - * @param string $position - * @return string - */ - public function encodeHeader($str, $position = 'text') - { - $matchcount = 0; - switch (strtolower($position)) { - case 'phrase': - if (!preg_match('/[\200-\377]/', $str)) { - // Can't use addslashes as we don't know the value of magic_quotes_sybase - $encoded = addcslashes($str, "\0..\37\177\\\""); - if (($str == $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { - return ($encoded); - } else { - return ("\"$encoded\""); - } - } - $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); - break; - /** @noinspection PhpMissingBreakStatementInspection */ - case 'comment': - $matchcount = preg_match_all('/[()"]/', $str, $matches); - // Intentional fall-through - case 'text': - default: - $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); - break; - } - - //There are no chars that need encoding - if ($matchcount == 0) { - return ($str); - } - - $maxlen = 75 - 7 - strlen($this->CharSet); - // Try to select the encoding which should produce the shortest output - if ($matchcount > strlen($str) / 3) { - // More than a third of the content will need encoding, so B encoding will be most efficient - $encoding = 'B'; - if (function_exists('mb_strlen') && $this->hasMultiBytes($str)) { - // Use a custom function which correctly encodes and wraps long - // multibyte strings without breaking lines within a character - $encoded = $this->base64EncodeWrapMB($str, "\n"); - } else { - $encoded = base64_encode($str); - $maxlen -= $maxlen % 4; - $encoded = trim(chunk_split($encoded, $maxlen, "\n")); - } - } else { - $encoding = 'Q'; - $encoded = $this->encodeQ($str, $position); - $encoded = $this->wrapText($encoded, $maxlen, true); - $encoded = str_replace('=' . self::CRLF, "\n", trim($encoded)); - } - - $encoded = preg_replace('/^(.*)$/m', ' =?' . $this->CharSet . "?$encoding?\\1?=", $encoded); - $encoded = trim(str_replace("\n", $this->LE, $encoded)); - - return $encoded; - } - - /** - * Check if a string contains multi-byte characters. - * @access public - * @param string $str multi-byte text to wrap encode - * @return boolean - */ - public function hasMultiBytes($str) - { - if (function_exists('mb_strlen')) { - return (strlen($str) > mb_strlen($str, $this->CharSet)); - } else { // Assume no multibytes (we can't handle without mbstring functions anyway) - return false; - } - } - - /** - * Does a string contain any 8-bit chars (in any charset)? - * @param string $text - * @return boolean - */ - public function has8bitChars($text) - { - return (boolean)preg_match('/[\x80-\xFF]/', $text); - } - - /** - * Encode and wrap long multibyte strings for mail headers - * without breaking lines within a character. - * Adapted from a function by paravoid - * @link http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 - * @access public - * @param string $str multi-byte text to wrap encode - * @param string $linebreak string to use as linefeed/end-of-line - * @return string - */ - public function base64EncodeWrapMB($str, $linebreak = null) - { - $start = '=?' . $this->CharSet . '?B?'; - $end = '?='; - $encoded = ''; - if ($linebreak === null) { - $linebreak = $this->LE; - } - - $mb_length = mb_strlen($str, $this->CharSet); - // Each line must have length <= 75, including $start and $end - $length = 75 - strlen($start) - strlen($end); - // Average multi-byte ratio - $ratio = $mb_length / strlen($str); - // Base64 has a 4:3 ratio - $avgLength = floor($length * $ratio * .75); - - for ($i = 0; $i < $mb_length; $i += $offset) { - $lookBack = 0; - do { - $offset = $avgLength - $lookBack; - $chunk = mb_substr($str, $i, $offset, $this->CharSet); - $chunk = base64_encode($chunk); - $lookBack++; - } while (strlen($chunk) > $length); - $encoded .= $chunk . $linebreak; - } - - // Chomp the last linefeed - $encoded = substr($encoded, 0, -strlen($linebreak)); - return $encoded; - } - - /** - * Encode a string in quoted-printable format. - * According to RFC2045 section 6.7. - * @access public - * @param string $string The text to encode - * @param integer $line_max Number of chars allowed on a line before wrapping - * @return string - * @link http://www.php.net/manual/en/function.quoted-printable-decode.php#89417 Adapted from this comment - */ - public function encodeQP($string, $line_max = 76) - { - // Use native function if it's available (>= PHP5.3) - if (function_exists('quoted_printable_encode')) { - return quoted_printable_encode($string); - } - // Fall back to a pure PHP implementation - $string = str_replace( - array('%20', '%0D%0A.', '%0D%0A', '%'), - array(' ', "\r\n=2E", "\r\n", '='), - rawurlencode($string) - ); - return preg_replace('/[^\r\n]{' . ($line_max - 3) . '}[^=\r\n]{2}/', "$0=\r\n", $string); - } - - /** - * Backward compatibility wrapper for an old QP encoding function that was removed. - * @see PHPMailer::encodeQP() - * @access public - * @param string $string - * @param integer $line_max - * @param boolean $space_conv - * @return string - * @deprecated Use encodeQP instead. - */ - public function encodeQPphp( - $string, - $line_max = 76, - /** @noinspection PhpUnusedParameterInspection */ $space_conv = false - ) { - return $this->encodeQP($string, $line_max); - } - - /** - * Encode a string using Q encoding. - * @link http://tools.ietf.org/html/rfc2047 - * @param string $str the text to encode - * @param string $position Where the text is going to be used, see the RFC for what that means - * @access public - * @return string - */ - public function encodeQ($str, $position = 'text') - { - // There should not be any EOL in the string - $pattern = ''; - $encoded = str_replace(array("\r", "\n"), '', $str); - switch (strtolower($position)) { - case 'phrase': - // RFC 2047 section 5.3 - $pattern = '^A-Za-z0-9!*+\/ -'; - break; - /** @noinspection PhpMissingBreakStatementInspection */ - case 'comment': - // RFC 2047 section 5.2 - $pattern = '\(\)"'; - // intentional fall-through - // for this reason we build the $pattern without including delimiters and [] - case 'text': - default: - // RFC 2047 section 5.1 - // Replace every high ascii, control, =, ? and _ characters - $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; - break; - } - $matches = array(); - if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { - // If the string contains an '=', make sure it's the first thing we replace - // so as to avoid double-encoding - $eqkey = array_search('=', $matches[0]); - if (false !== $eqkey) { - unset($matches[0][$eqkey]); - array_unshift($matches[0], '='); - } - foreach (array_unique($matches[0]) as $char) { - $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); - } - } - // Replace every spaces to _ (more readable than =20) - return str_replace(' ', '_', $encoded); - } - - /** - * Add a string or binary attachment (non-filesystem). - * This method can be used to attach ascii or binary data, - * such as a BLOB record from a database. - * @param string $string String attachment data. - * @param string $filename Name of the attachment. - * @param string $encoding File encoding (see $Encoding). - * @param string $type File extension (MIME) type. - * @param string $disposition Disposition to use - * @return void - */ - public function addStringAttachment( - $string, - $filename, - $encoding = 'base64', - $type = '', - $disposition = 'attachment' - ) { - // If a MIME type is not specified, try to work it out from the file name - if ($type == '') { - $type = self::filenameToType($filename); - } - // Append to $attachment array - $this->attachment[] = array( - 0 => $string, - 1 => $filename, - 2 => basename($filename), - 3 => $encoding, - 4 => $type, - 5 => true, // isStringAttachment - 6 => $disposition, - 7 => 0 - ); - } - - /** - * Add an embedded (inline) attachment from a file. - * This can include images, sounds, and just about any other document type. - * These differ from 'regular' attachments in that they are intended to be - * displayed inline with the message, not just attached for download. - * This is used in HTML messages that embed the images - * the HTML refers to using the $cid value. - * Never use a user-supplied path to a file! - * @param string $path Path to the attachment. - * @param string $cid Content ID of the attachment; Use this to reference - * the content when using an embedded image in HTML. - * @param string $name Overrides the attachment name. - * @param string $encoding File encoding (see $Encoding). - * @param string $type File MIME type. - * @param string $disposition Disposition to use - * @return boolean True on successfully adding an attachment - */ - public function addEmbeddedImage($path, $cid, $name = '', $encoding = 'base64', $type = '', $disposition = 'inline') - { - if (!@is_file($path)) { - $this->setError($this->lang('file_access') . $path); - return false; - } - - // If a MIME type is not specified, try to work it out from the file name - if ($type == '') { - $type = self::filenameToType($path); - } - - $filename = basename($path); - if ($name == '') { - $name = $filename; - } - - // Append to $attachment array - $this->attachment[] = array( - 0 => $path, - 1 => $filename, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => false, // isStringAttachment - 6 => $disposition, - 7 => $cid - ); - return true; - } - - /** - * Add an embedded stringified attachment. - * This can include images, sounds, and just about any other document type. - * Be sure to set the $type to an image type for images: - * JPEG images use 'image/jpeg', GIF uses 'image/gif', PNG uses 'image/png'. - * @param string $string The attachment binary data. - * @param string $cid Content ID of the attachment; Use this to reference - * the content when using an embedded image in HTML. - * @param string $name - * @param string $encoding File encoding (see $Encoding). - * @param string $type MIME type. - * @param string $disposition Disposition to use - * @return boolean True on successfully adding an attachment - */ - public function addStringEmbeddedImage( - $string, - $cid, - $name = '', - $encoding = 'base64', - $type = '', - $disposition = 'inline' - ) { - // If a MIME type is not specified, try to work it out from the name - if ($type == '' and !empty($name)) { - $type = self::filenameToType($name); - } - - // Append to $attachment array - $this->attachment[] = array( - 0 => $string, - 1 => $name, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => true, // isStringAttachment - 6 => $disposition, - 7 => $cid - ); - return true; - } - - /** - * Check if an inline attachment is present. - * @access public - * @return boolean - */ - public function inlineImageExists() - { - foreach ($this->attachment as $attachment) { - if ($attachment[6] == 'inline') { - return true; - } - } - return false; - } - - /** - * Check if an attachment (non-inline) is present. - * @return boolean - */ - public function attachmentExists() - { - foreach ($this->attachment as $attachment) { - if ($attachment[6] == 'attachment') { - return true; - } - } - return false; - } - - /** - * Check if this message has an alternative body set. - * @return boolean - */ - public function alternativeExists() - { - return !empty($this->AltBody); - } - - /** - * Clear queued addresses of given kind. - * @access protected - * @param string $kind 'to', 'cc', or 'bcc' - * @return void - */ - public function clearQueuedAddresses($kind) - { - $RecipientsQueue = $this->RecipientsQueue; - foreach ($RecipientsQueue as $address => $params) { - if ($params[0] == $kind) { - unset($this->RecipientsQueue[$address]); - } - } - } - - /** - * Clear all To recipients. - * @return void - */ - public function clearAddresses() - { - foreach ($this->to as $to) { - unset($this->all_recipients[strtolower($to[0])]); - } - $this->to = array(); - $this->clearQueuedAddresses('to'); - } - - /** - * Clear all CC recipients. - * @return void - */ - public function clearCCs() - { - foreach ($this->cc as $cc) { - unset($this->all_recipients[strtolower($cc[0])]); - } - $this->cc = array(); - $this->clearQueuedAddresses('cc'); - } - - /** - * Clear all BCC recipients. - * @return void - */ - public function clearBCCs() - { - foreach ($this->bcc as $bcc) { - unset($this->all_recipients[strtolower($bcc[0])]); - } - $this->bcc = array(); - $this->clearQueuedAddresses('bcc'); - } - - /** - * Clear all ReplyTo recipients. - * @return void - */ - public function clearReplyTos() - { - $this->ReplyTo = array(); - $this->ReplyToQueue = array(); - } - - /** - * Clear all recipient types. - * @return void - */ - public function clearAllRecipients() - { - $this->to = array(); - $this->cc = array(); - $this->bcc = array(); - $this->all_recipients = array(); - $this->RecipientsQueue = array(); - } - - /** - * Clear all filesystem, string, and binary attachments. - * @return void - */ - public function clearAttachments() - { - $this->attachment = array(); - } - - /** - * Clear all custom headers. - * @return void - */ - public function clearCustomHeaders() - { - $this->CustomHeader = array(); - } - - /** - * Add an error message to the error container. - * @access protected - * @param string $msg - * @return void - */ - protected function setError($msg) - { - $this->error_count++; - if ($this->Mailer == 'smtp' and !is_null($this->smtp)) { - $lasterror = $this->smtp->getError(); - if (!empty($lasterror['error'])) { - $msg .= $this->lang('smtp_error') . $lasterror['error']; - if (!empty($lasterror['detail'])) { - $msg .= ' Detail: '. $lasterror['detail']; - } - if (!empty($lasterror['smtp_code'])) { - $msg .= ' SMTP code: ' . $lasterror['smtp_code']; - } - if (!empty($lasterror['smtp_code_ex'])) { - $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; - } - } - } - $this->ErrorInfo = $msg; - } - - /** - * Return an RFC 822 formatted date. - * @access public - * @return string - * @static - */ - public static function rfcDate() - { - // Set the time zone to whatever the default is to avoid 500 errors - // Will default to UTC if it's not set properly in php.ini - date_default_timezone_set(@date_default_timezone_get()); - return date('D, j M Y H:i:s O'); - } - - /** - * Get the server hostname. - * Returns 'localhost.localdomain' if unknown. - * @access protected - * @return string - */ - protected function serverHostname() - { - $result = 'localhost.localdomain'; - if (!empty($this->Hostname)) { - $result = $this->Hostname; - } elseif (isset($_SERVER) and array_key_exists('SERVER_NAME', $_SERVER) and !empty($_SERVER['SERVER_NAME'])) { - $result = $_SERVER['SERVER_NAME']; - } elseif (function_exists('gethostname') && gethostname() !== false) { - $result = gethostname(); - } elseif (php_uname('n') !== false) { - $result = php_uname('n'); - } - return $result; - } - - /** - * Get an error message in the current language. - * @access protected - * @param string $key - * @return string - */ - protected function lang($key) - { - if (count($this->language) < 1) { - $this->setLanguage('en'); // set the default language - } - - if (array_key_exists($key, $this->language)) { - if ($key == 'smtp_connect_failed') { - //Include a link to troubleshooting docs on SMTP connection failure - //this is by far the biggest cause of support questions - //but it's usually not PHPMailer's fault. - return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; - } - return $this->language[$key]; - } else { - //Return the key as a fallback - return $key; - } - } - - /** - * Check if an error occurred. - * @access public - * @return boolean True if an error did occur. - */ - public function isError() - { - return ($this->error_count > 0); - } - - /** - * Ensure consistent line endings in a string. - * Changes every end of line from CRLF, CR or LF to $this->LE. - * @access public - * @param string $str String to fixEOL - * @return string - */ - public function fixEOL($str) - { - // Normalise to \n - $nstr = str_replace(array("\r\n", "\r"), "\n", $str); - // Now convert LE as needed - if ($this->LE !== "\n") { - $nstr = str_replace("\n", $this->LE, $nstr); - } - return $nstr; - } - - /** - * Add a custom header. - * $name value can be overloaded to contain - * both header name and value (name:value) - * @access public - * @param string $name Custom header name - * @param string $value Header value - * @return void - */ - public function addCustomHeader($name, $value = null) - { - if ($value === null) { - // Value passed in as name:value - $this->CustomHeader[] = explode(':', $name, 2); - } else { - $this->CustomHeader[] = array($name, $value); - } - } - - /** - * Returns all custom headers. - * @return array - */ - public function getCustomHeaders() - { - return $this->CustomHeader; - } - - /** - * Create a message body from an HTML string. - * Automatically inlines images and creates a plain-text version by converting the HTML, - * overwriting any existing values in Body and AltBody. - * Do not source $message content from user input! - * $basedir is prepended when handling relative URLs, e.g. and must not be empty - * will look for an image file in $basedir/images/a.png and convert it to inline. - * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) - * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly. - * @access public - * @param string $message HTML message string - * @param string $basedir Absolute path to a base directory to prepend to relative paths to images - * @param boolean|callable $advanced Whether to use the internal HTML to text converter - * or your own custom converter @see PHPMailer::html2text() - * @return string $message The transformed message Body - */ - public function msgHTML($message, $basedir = '', $advanced = false) - { - preg_match_all('/(src|background)=["\'](.*)["\']/Ui', $message, $images); - if (array_key_exists(2, $images)) { - if (strlen($basedir) > 1 && substr($basedir, -1) != '/') { - // Ensure $basedir has a trailing / - $basedir .= '/'; - } - foreach ($images[2] as $imgindex => $url) { - // Convert data URIs into embedded images - if (preg_match('#^data:(image[^;,]*)(;base64)?,#', $url, $match)) { - $data = substr($url, strpos($url, ',')); - if ($match[2]) { - $data = base64_decode($data); - } else { - $data = rawurldecode($data); - } - $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 - if ($this->addStringEmbeddedImage($data, $cid, 'embed' . $imgindex, 'base64', $match[1])) { - $message = str_replace( - $images[0][$imgindex], - $images[1][$imgindex] . '="cid:' . $cid . '"', - $message - ); - } - continue; - } - if ( - // Only process relative URLs if a basedir is provided (i.e. no absolute local paths) - !empty($basedir) - // Ignore URLs containing parent dir traversal (..) - && (strpos($url, '..') === false) - // Do not change urls that are already inline images - && substr($url, 0, 4) !== 'cid:' - // Do not change absolute URLs, including anonymous protocol - && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) - ) { - $filename = basename($url); - $directory = dirname($url); - if ($directory == '.') { - $directory = ''; - } - $cid = md5($url) . '@phpmailer.0'; // RFC2392 S 2 - if (strlen($directory) > 1 && substr($directory, -1) != '/') { - $directory .= '/'; - } - if ($this->addEmbeddedImage( - $basedir . $directory . $filename, - $cid, - $filename, - 'base64', - self::_mime_types((string)self::mb_pathinfo($filename, PATHINFO_EXTENSION)) - ) - ) { - $message = preg_replace( - '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', - $images[1][$imgindex] . '="cid:' . $cid . '"', - $message - ); - } - } - } - } - $this->isHTML(true); - // Convert all message body line breaks to CRLF, makes quoted-printable encoding work much better - $this->Body = $this->normalizeBreaks($message); - $this->AltBody = $this->normalizeBreaks($this->html2text($message, $advanced)); - if (!$this->alternativeExists()) { - $this->AltBody = 'To view this email message, open it in a program that understands HTML!' . - self::CRLF . self::CRLF; - } - return $this->Body; - } - - /** - * Convert an HTML string into plain text. - * This is used by msgHTML(). - * Note - older versions of this function used a bundled advanced converter - * which was been removed for license reasons in #232. - * Example usage: - * - * // Use default conversion - * $plain = $mail->html2text($html); - * // Use your own custom converter - * $plain = $mail->html2text($html, function($html) { - * $converter = new MyHtml2text($html); - * return $converter->get_text(); - * }); - * - * @param string $html The HTML text to convert - * @param boolean|callable $advanced Any boolean value to use the internal converter, - * or provide your own callable for custom conversion. - * @return string - */ - public function html2text($html, $advanced = false) - { - if (is_callable($advanced)) { - return call_user_func($advanced, $html); - } - return html_entity_decode( - trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), - ENT_QUOTES, - $this->CharSet - ); - } - - /** - * Get the MIME type for a file extension. - * @param string $ext File extension - * @access public - * @return string MIME type of file. - * @static - */ - public static function _mime_types($ext = '') - { - $mimes = array( - 'xl' => 'application/excel', - 'js' => 'application/javascript', - 'hqx' => 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'bin' => 'application/macbinary', - 'doc' => 'application/msword', - 'word' => 'application/msword', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'class' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'dms' => 'application/octet-stream', - 'exe' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'psd' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'so' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => 'application/pdf', - 'ai' => 'application/postscript', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/vnd.ms-powerpoint', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'php3' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => 'application/x-tar', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'zip' => 'application/zip', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mp2' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'mpga' => 'audio/mpeg', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'wav' => 'audio/x-wav', - 'bmp' => 'image/bmp', - 'gif' => 'image/gif', - 'jpeg' => 'image/jpeg', - 'jpe' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'png' => 'image/png', - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'eml' => 'message/rfc822', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'log' => 'text/plain', - 'text' => 'text/plain', - 'txt' => 'text/plain', - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'vcf' => 'text/vcard', - 'vcard' => 'text/vcard', - 'xml' => 'text/xml', - 'xsl' => 'text/xml', - 'mpeg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mov' => 'video/quicktime', - 'qt' => 'video/quicktime', - 'rv' => 'video/vnd.rn-realvideo', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie' - ); - if (array_key_exists(strtolower($ext), $mimes)) { - return $mimes[strtolower($ext)]; - } - return 'application/octet-stream'; - } - - /** - * Map a file name to a MIME type. - * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. - * @param string $filename A file name or full path, does not need to exist as a file - * @return string - * @static - */ - public static function filenameToType($filename) - { - // In case the path is a URL, strip any query string before getting extension - $qpos = strpos($filename, '?'); - if (false !== $qpos) { - $filename = substr($filename, 0, $qpos); - } - $pathinfo = self::mb_pathinfo($filename); - return self::_mime_types($pathinfo['extension']); - } - - /** - * Multi-byte-safe pathinfo replacement. - * Drop-in replacement for pathinfo(), but multibyte-safe, cross-platform-safe, old-version-safe. - * Works similarly to the one in PHP >= 5.2.0 - * @link http://www.php.net/manual/en/function.pathinfo.php#107461 - * @param string $path A filename or path, does not need to exist as a file - * @param integer|string $options Either a PATHINFO_* constant, - * or a string name to return only the specified piece, allows 'filename' to work on PHP < 5.2 - * @return string|array - * @static - */ - public static function mb_pathinfo($path, $options = null) - { - $ret = array('dirname' => '', 'basename' => '', 'extension' => '', 'filename' => ''); - $pathinfo = array(); - if (preg_match('%^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^\.\\\\/]+?)|))[\\\\/\.]*$%im', $path, $pathinfo)) { - if (array_key_exists(1, $pathinfo)) { - $ret['dirname'] = $pathinfo[1]; - } - if (array_key_exists(2, $pathinfo)) { - $ret['basename'] = $pathinfo[2]; - } - if (array_key_exists(5, $pathinfo)) { - $ret['extension'] = $pathinfo[5]; - } - if (array_key_exists(3, $pathinfo)) { - $ret['filename'] = $pathinfo[3]; - } - } - switch ($options) { - case PATHINFO_DIRNAME: - case 'dirname': - return $ret['dirname']; - case PATHINFO_BASENAME: - case 'basename': - return $ret['basename']; - case PATHINFO_EXTENSION: - case 'extension': - return $ret['extension']; - case PATHINFO_FILENAME: - case 'filename': - return $ret['filename']; - default: - return $ret; - } - } - - /** - * Set or reset instance properties. - * You should avoid this function - it's more verbose, less efficient, more error-prone and - * harder to debug than setting properties directly. - * Usage Example: - * `$mail->set('SMTPSecure', 'tls');` - * is the same as: - * `$mail->SMTPSecure = 'tls';` - * @access public - * @param string $name The property name to set - * @param mixed $value The value to set the property to - * @return boolean - * @TODO Should this not be using the __set() magic function? - */ - public function set($name, $value = '') - { - if (property_exists($this, $name)) { - $this->$name = $value; - return true; - } else { - $this->setError($this->lang('variable_set') . $name); - return false; - } - } - - /** - * Strip newlines to prevent header injection. - * @access public - * @param string $str - * @return string - */ - public function secureHeader($str) - { - return trim(str_replace(array("\r", "\n"), '', $str)); - } - - /** - * Normalize line breaks in a string. - * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. - * Defaults to CRLF (for message bodies) and preserves consecutive breaks. - * @param string $text - * @param string $breaktype What kind of line break to use, defaults to CRLF - * @return string - * @access public - * @static - */ - public static function normalizeBreaks($text, $breaktype = "\r\n") - { - return preg_replace('/(\r\n|\r|\n)/ms', $breaktype, $text); - } - - /** - * Set the public and private key files and password for S/MIME signing. - * @access public - * @param string $cert_filename - * @param string $key_filename - * @param string $key_pass Password for private key - * @param string $extracerts_filename Optional path to chain certificate - */ - public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') - { - $this->sign_cert_file = $cert_filename; - $this->sign_key_file = $key_filename; - $this->sign_key_pass = $key_pass; - $this->sign_extracerts_file = $extracerts_filename; - } - - /** - * Quoted-Printable-encode a DKIM header. - * @access public - * @param string $txt - * @return string - */ - public function DKIM_QP($txt) - { - $line = ''; - for ($i = 0; $i < strlen($txt); $i++) { - $ord = ord($txt[$i]); - if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord == 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { - $line .= $txt[$i]; - } else { - $line .= '=' . sprintf('%02X', $ord); - } - } - return $line; - } - - /** - * Generate a DKIM signature. - * @access public - * @param string $signHeader - * @throws phpmailerException - * @return string The DKIM signature value - */ - public function DKIM_Sign($signHeader) - { - if (!defined('PKCS7_TEXT')) { - if ($this->exceptions) { - throw new phpmailerException($this->lang('extension_missing') . 'openssl'); - } - return ''; - } - $privKeyStr = !empty($this->DKIM_private_string) ? $this->DKIM_private_string : file_get_contents($this->DKIM_private); - if ('' != $this->DKIM_passphrase) { - $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); - } else { - $privKey = openssl_pkey_get_private($privKeyStr); - } - //Workaround for missing digest algorithms in old PHP & OpenSSL versions - //@link http://stackoverflow.com/a/11117338/333340 - if (version_compare(PHP_VERSION, '5.3.0') >= 0 and - in_array('sha256WithRSAEncryption', openssl_get_md_methods(true))) { - if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { - openssl_pkey_free($privKey); - return base64_encode($signature); - } - } else { - $pinfo = openssl_pkey_get_details($privKey); - $hash = hash('sha256', $signHeader); - //'Magic' constant for SHA256 from RFC3447 - //@link https://tools.ietf.org/html/rfc3447#page-43 - $t = '3031300d060960864801650304020105000420' . $hash; - $pslen = $pinfo['bits'] / 8 - (strlen($t) / 2 + 3); - $eb = pack('H*', '0001' . str_repeat('FF', $pslen) . '00' . $t); - - if (openssl_private_encrypt($eb, $signature, $privKey, OPENSSL_NO_PADDING)) { - openssl_pkey_free($privKey); - return base64_encode($signature); - } - } - openssl_pkey_free($privKey); - return ''; - } - - /** - * Generate a DKIM canonicalization header. - * @access public - * @param string $signHeader Header - * @return string - */ - public function DKIM_HeaderC($signHeader) - { - $signHeader = preg_replace('/\r\n\s+/', ' ', $signHeader); - $lines = explode("\r\n", $signHeader); - foreach ($lines as $key => $line) { - list($heading, $value) = explode(':', $line, 2); - $heading = strtolower($heading); - $value = preg_replace('/\s{2,}/', ' ', $value); // Compress useless spaces - $lines[$key] = $heading . ':' . trim($value); // Don't forget to remove WSP around the value - } - $signHeader = implode("\r\n", $lines); - return $signHeader; - } - - /** - * Generate a DKIM canonicalization body. - * @access public - * @param string $body Message Body - * @return string - */ - public function DKIM_BodyC($body) - { - if ($body == '') { - return "\r\n"; - } - // stabilize line endings - $body = str_replace("\r\n", "\n", $body); - $body = str_replace("\n", "\r\n", $body); - // END stabilize line endings - while (substr($body, strlen($body) - 4, 4) == "\r\n\r\n") { - $body = substr($body, 0, strlen($body) - 2); - } - return $body; - } - - /** - * Create the DKIM header and body in a new message header. - * @access public - * @param string $headers_line Header lines - * @param string $subject Subject - * @param string $body Body - * @return string - */ - public function DKIM_Add($headers_line, $subject, $body) - { - $DKIMsignatureType = 'rsa-sha256'; // Signature & hash algorithms - $DKIMcanonicalization = 'relaxed/simple'; // Canonicalization of header/body - $DKIMquery = 'dns/txt'; // Query method - $DKIMtime = time(); // Signature Timestamp = seconds since 00:00:00 - Jan 1, 1970 (UTC time zone) - $subject_header = "Subject: $subject"; - $headers = explode($this->LE, $headers_line); - $from_header = ''; - $to_header = ''; - $date_header = ''; - $current = ''; - foreach ($headers as $header) { - if (strpos($header, 'From:') === 0) { - $from_header = $header; - $current = 'from_header'; - } elseif (strpos($header, 'To:') === 0) { - $to_header = $header; - $current = 'to_header'; - } elseif (strpos($header, 'Date:') === 0) { - $date_header = $header; - $current = 'date_header'; - } else { - if (!empty($$current) && strpos($header, ' =?') === 0) { - $$current .= $header; - } else { - $current = ''; - } - } - } - $from = str_replace('|', '=7C', $this->DKIM_QP($from_header)); - $to = str_replace('|', '=7C', $this->DKIM_QP($to_header)); - $date = str_replace('|', '=7C', $this->DKIM_QP($date_header)); - $subject = str_replace( - '|', - '=7C', - $this->DKIM_QP($subject_header) - ); // Copied header fields (dkim-quoted-printable) - $body = $this->DKIM_BodyC($body); - $DKIMlen = strlen($body); // Length of body - $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); // Base64 of packed binary SHA-256 hash of body - if ('' == $this->DKIM_identity) { - $ident = ''; - } else { - $ident = ' i=' . $this->DKIM_identity . ';'; - } - $dkimhdrs = 'DKIM-Signature: v=1; a=' . - $DKIMsignatureType . '; q=' . - $DKIMquery . '; l=' . - $DKIMlen . '; s=' . - $this->DKIM_selector . - ";\r\n" . - "\tt=" . $DKIMtime . '; c=' . $DKIMcanonicalization . ";\r\n" . - "\th=From:To:Date:Subject;\r\n" . - "\td=" . $this->DKIM_domain . ';' . $ident . "\r\n" . - "\tz=$from\r\n" . - "\t|$to\r\n" . - "\t|$date\r\n" . - "\t|$subject;\r\n" . - "\tbh=" . $DKIMb64 . ";\r\n" . - "\tb="; - $toSign = $this->DKIM_HeaderC( - $from_header . "\r\n" . - $to_header . "\r\n" . - $date_header . "\r\n" . - $subject_header . "\r\n" . - $dkimhdrs - ); - $signed = $this->DKIM_Sign($toSign); - return $dkimhdrs . $signed . "\r\n"; - } - - /** - * Detect if a string contains a line longer than the maximum line length allowed. - * @param string $str - * @return boolean - * @static - */ - public static function hasLineLongerThanMax($str) - { - //+2 to include CRLF line break for a 1000 total - return (boolean)preg_match('/^(.{'.(self::MAX_LINE_LENGTH + 2).',})/m', $str); - } - - /** - * Allows for public read access to 'to' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getToAddresses() - { - return $this->to; - } - - /** - * Allows for public read access to 'cc' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getCcAddresses() - { - return $this->cc; - } - - /** - * Allows for public read access to 'bcc' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getBccAddresses() - { - return $this->bcc; - } - - /** - * Allows for public read access to 'ReplyTo' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getReplyToAddresses() - { - return $this->ReplyTo; - } - - /** - * Allows for public read access to 'all_recipients' property. - * @note: Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * @access public - * @return array - */ - public function getAllRecipientAddresses() - { - return $this->all_recipients; - } - - /** - * Perform a callback. - * @param boolean $isSent - * @param array $to - * @param array $cc - * @param array $bcc - * @param string $subject - * @param string $body - * @param string $from - */ - protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from) - { - if (!empty($this->action_function) && is_callable($this->action_function)) { - $params = array($isSent, $to, $cc, $bcc, $subject, $body, $from); - call_user_func_array($this->action_function, $params); - } - } -} - -/** - * PHPMailer exception handler - * @package PHPMailer - */ -class phpmailerException extends Exception -{ - /** - * Prettify error message output - * @return string - */ - public function errorMessage() - { - $errorMsg = '' . $this->getMessage() . "
\n"; - return $errorMsg; - } -} diff --git a/app/vendor/phpmailer/class.smtp.php b/app/vendor/phpmailer/class.smtp.php deleted file mode 100644 index 01cee82..0000000 --- a/app/vendor/phpmailer/class.smtp.php +++ /dev/null @@ -1,1251 +0,0 @@ - - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - * @author Brent R. Matzelle (original founder) - * @copyright 2014 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. - */ - -/** - * PHPMailer RFC821 SMTP email transport class. - * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. - * @package PHPMailer - * @author Chris Ryan - * @author Marcus Bointon - */ -class SMTP -{ - /** - * The PHPMailer SMTP version number. - * @var string - */ - const VERSION = '5.2.23'; - - /** - * SMTP line break constant. - * @var string - */ - const CRLF = "\r\n"; - - /** - * The SMTP port to use if one is not specified. - * @var integer - */ - const DEFAULT_SMTP_PORT = 25; - - /** - * The maximum line length allowed by RFC 2822 section 2.1.1 - * @var integer - */ - const MAX_LINE_LENGTH = 998; - - /** - * Debug level for no output - */ - const DEBUG_OFF = 0; - - /** - * Debug level to show client -> server messages - */ - const DEBUG_CLIENT = 1; - - /** - * Debug level to show client -> server and server -> client messages - */ - const DEBUG_SERVER = 2; - - /** - * Debug level to show connection status, client -> server and server -> client messages - */ - const DEBUG_CONNECTION = 3; - - /** - * Debug level to show all messages - */ - const DEBUG_LOWLEVEL = 4; - - /** - * The PHPMailer SMTP Version number. - * @var string - * @deprecated Use the `VERSION` constant instead - * @see SMTP::VERSION - */ - public $Version = '5.2.23'; - - /** - * SMTP server port number. - * @var integer - * @deprecated This is only ever used as a default value, so use the `DEFAULT_SMTP_PORT` constant instead - * @see SMTP::DEFAULT_SMTP_PORT - */ - public $SMTP_PORT = 25; - - /** - * SMTP reply line ending. - * @var string - * @deprecated Use the `CRLF` constant instead - * @see SMTP::CRLF - */ - public $CRLF = "\r\n"; - - /** - * Debug output level. - * Options: - * * self::DEBUG_OFF (`0`) No debug output, default - * * self::DEBUG_CLIENT (`1`) Client commands - * * self::DEBUG_SERVER (`2`) Client commands and server responses - * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status - * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages - * @var integer - */ - public $do_debug = self::DEBUG_OFF; - - /** - * 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 - * - * Alternatively, you can provide a callable expecting two params: a message string and the debug level: - * - * $smtp->Debugoutput = function($str, $level) {echo "debug level $level; message: $str";}; - * - * @var string|callable - */ - public $Debugoutput = 'echo'; - - /** - * Whether to use VERP. - * @link http://en.wikipedia.org/wiki/Variable_envelope_return_path - * @link http://www.postfix.org/VERP_README.html Info on VERP - * @var boolean - */ - public $do_verp = false; - - /** - * The timeout value for connection, in seconds. - * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 - * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. - * @link http://tools.ietf.org/html/rfc2821#section-4.5.3.2 - * @var integer - */ - public $Timeout = 300; - - /** - * How long to wait for commands to complete, in seconds. - * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2 - * @var integer - */ - public $Timelimit = 300; - - /** - * @var array patterns to extract smtp transaction id from smtp reply - * Only first capture group will be use, use non-capturing group to deal with it - * Extend this class to override this property to fulfil your needs. - */ - protected $smtp_transaction_id_patterns = array( - 'exim' => '/[0-9]{3} OK id=(.*)/', - 'sendmail' => '/[0-9]{3} 2.0.0 (.*) Message/', - 'postfix' => '/[0-9]{3} 2.0.0 Ok: queued as (.*)/' - ); - - /** - * The socket for the server connection. - * @var resource - */ - protected $smtp_conn; - - /** - * Error information, if any, for the last SMTP command. - * @var array - */ - protected $error = array( - 'error' => '', - 'detail' => '', - 'smtp_code' => '', - 'smtp_code_ex' => '' - ); - - /** - * The reply the server sent to us for HELO. - * If null, no HELO string has yet been received. - * @var string|null - */ - protected $helo_rply = null; - - /** - * The set of SMTP extensions sent in reply to EHLO command. - * Indexes of the array are extension names. - * Value at index 'HELO' or 'EHLO' (according to command that was sent) - * represents the server name. In case of HELO it is the only element of the array. - * Other values can be boolean TRUE or an array containing extension options. - * If null, no HELO/EHLO string has yet been received. - * @var array|null - */ - protected $server_caps = null; - - /** - * The most recent reply received from the server. - * @var string - */ - protected $last_reply = ''; - - /** - * Output debugging info via a user-selected method. - * @see SMTP::$Debugoutput - * @see SMTP::$do_debug - * @param string $str Debug string to output - * @param integer $level The debug level of this message; see DEBUG_* constants - * @return void - */ - protected function edebug($str, $level = 0) - { - if ($level > $this->do_debug) { - return; - } - //Avoid clash with built-in function names - if (!in_array($this->Debugoutput, array('error_log', 'html', 'echo')) and is_callable($this->Debugoutput)) { - call_user_func($this->Debugoutput, $str, $level); - return; - } - switch ($this->Debugoutput) { - case 'error_log': - //Don't output, just log - 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|\n)/ms', "\n", $str); - echo gmdate('Y-m-d H:i:s') . "\t" . str_replace( - "\n", - "\n \t ", - trim($str) - ) . "\n"; - } - } - - /** - * Connect to an SMTP server. - * @param string $host SMTP server IP or host name - * @param integer $port The port number to connect to - * @param integer $timeout How long to wait for the connection to open - * @param array $options An array of options for stream_context_create() - * @access public - * @return boolean - */ - public function connect($host, $port = null, $timeout = 30, $options = array()) - { - static $streamok; - //This is enabled by default since 5.0.0 but some providers disable it - //Check this once and cache the result - if (is_null($streamok)) { - $streamok = function_exists('stream_socket_client'); - } - // Clear errors to avoid confusion - $this->setError(''); - // Make sure we are __not__ connected - if ($this->connected()) { - // Already connected, generate error - $this->setError('Already connected to a server'); - return false; - } - if (empty($port)) { - $port = self::DEFAULT_SMTP_PORT; - } - // Connect to the SMTP server - $this->edebug( - "Connection: opening to $host:$port, timeout=$timeout, options=" . - var_export($options, true), - self::DEBUG_CONNECTION - ); - $errno = 0; - $errstr = ''; - if ($streamok) { - $socket_context = stream_context_create($options); - set_error_handler(array($this, 'errorHandler')); - $this->smtp_conn = stream_socket_client( - $host . ":" . $port, - $errno, - $errstr, - $timeout, - STREAM_CLIENT_CONNECT, - $socket_context - ); - restore_error_handler(); - } else { - //Fall back to fsockopen which should work in more places, but is missing some features - $this->edebug( - "Connection: stream_socket_client not available, falling back to fsockopen", - self::DEBUG_CONNECTION - ); - set_error_handler(array($this, 'errorHandler')); - $this->smtp_conn = fsockopen( - $host, - $port, - $errno, - $errstr, - $timeout - ); - restore_error_handler(); - } - // Verify we connected properly - if (!is_resource($this->smtp_conn)) { - $this->setError( - 'Failed to connect to server', - $errno, - $errstr - ); - $this->edebug( - 'SMTP ERROR: ' . $this->error['error'] - . ": $errstr ($errno)", - self::DEBUG_CLIENT - ); - return false; - } - $this->edebug('Connection: opened', self::DEBUG_CONNECTION); - // SMTP server can take longer to respond, give longer timeout for first read - // Windows does not have support for this timeout function - if (substr(PHP_OS, 0, 3) != 'WIN') { - $max = ini_get('max_execution_time'); - // Don't bother if unlimited - if ($max != 0 && $timeout > $max) { - @set_time_limit($timeout); - } - stream_set_timeout($this->smtp_conn, $timeout, 0); - } - // Get any announcement - $announce = $this->get_lines(); - $this->edebug('SERVER -> CLIENT: ' . $announce, self::DEBUG_SERVER); - return true; - } - - /** - * Initiate a TLS (encrypted) session. - * @access public - * @return boolean - */ - public function startTLS() - { - if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { - return false; - } - - //Allow the best TLS version(s) we can - $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; - - //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT - //so add them back in manually if we can - if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { - $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; - $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; - } - - // Begin encrypted connection - set_error_handler(array($this, 'errorHandler')); - $crypto_ok = stream_socket_enable_crypto( - $this->smtp_conn, - true, - $crypto_method - ); - restore_error_handler(); - return $crypto_ok; - } - - /** - * Perform SMTP authentication. - * Must be run after hello(). - * @see hello() - * @param string $username The user name - * @param string $password The password - * @param string $authtype The auth type (PLAIN, LOGIN, NTLM, CRAM-MD5, XOAUTH2) - * @param string $realm The auth realm for NTLM - * @param string $workstation The auth workstation for NTLM - * @param null|OAuth $OAuth An optional OAuth instance (@see PHPMailerOAuth) - * @return bool True if successfully authenticated.* @access public - */ - public function authenticate( - $username, - $password, - $authtype = null, - $realm = '', - $workstation = '', - $OAuth = null - ) { - if (!$this->server_caps) { - $this->setError('Authentication is not allowed before HELO/EHLO'); - return false; - } - - if (array_key_exists('EHLO', $this->server_caps)) { - // SMTP extensions are available; try to find a proper authentication method - if (!array_key_exists('AUTH', $this->server_caps)) { - $this->setError('Authentication is not allowed at this stage'); - // 'at this stage' means that auth may be allowed after the stage changes - // e.g. after STARTTLS - return false; - } - - self::edebug('Auth method requested: ' . ($authtype ? $authtype : 'UNKNOWN'), self::DEBUG_LOWLEVEL); - self::edebug( - 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), - self::DEBUG_LOWLEVEL - ); - - if (empty($authtype)) { - foreach (array('CRAM-MD5', 'LOGIN', 'PLAIN', 'NTLM', 'XOAUTH2') as $method) { - if (in_array($method, $this->server_caps['AUTH'])) { - $authtype = $method; - break; - } - } - if (empty($authtype)) { - $this->setError('No supported authentication methods found'); - return false; - } - self::edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); - } - - if (!in_array($authtype, $this->server_caps['AUTH'])) { - $this->setError("The requested authentication method \"$authtype\" is not supported by the server"); - return false; - } - } elseif (empty($authtype)) { - $authtype = 'LOGIN'; - } - switch ($authtype) { - case 'PLAIN': - // Start authentication - if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { - return false; - } - // Send encoded username and password - if (!$this->sendCommand( - 'User & Password', - base64_encode("\0" . $username . "\0" . $password), - 235 - ) - ) { - return false; - } - break; - case 'LOGIN': - // Start authentication - if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { - return false; - } - if (!$this->sendCommand("Username", base64_encode($username), 334)) { - return false; - } - if (!$this->sendCommand("Password", base64_encode($password), 235)) { - return false; - } - break; - case 'XOAUTH2': - //If the OAuth Instance is not set. Can be a case when PHPMailer is used - //instead of PHPMailerOAuth - if (is_null($OAuth)) { - return false; - } - $oauth = $OAuth->getOauth64(); - - // Start authentication - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { - return false; - } - break; - case 'NTLM': - /* - * ntlm_sasl_client.php - * Bundled with Permission - * - * How to telnet in windows: - * http://technet.microsoft.com/en-us/library/aa995718%28EXCHG.65%29.aspx - * PROTOCOL Docs http://curl.haxx.se/rfc/ntlm.html#ntlmSmtpAuthentication - */ - require_once 'extras/ntlm_sasl_client.php'; - $temp = new stdClass; - $ntlm_client = new ntlm_sasl_client_class; - //Check that functions are available - if (!$ntlm_client->initialize($temp)) { - $this->setError($temp->error); - $this->edebug( - 'You need to enable some modules in your php.ini file: ' - . $this->error['error'], - self::DEBUG_CLIENT - ); - return false; - } - //msg1 - $msg1 = $ntlm_client->typeMsg1($realm, $workstation); //msg1 - - if (!$this->sendCommand( - 'AUTH NTLM', - 'AUTH NTLM ' . base64_encode($msg1), - 334 - ) - ) { - return false; - } - //Though 0 based, there is a white space after the 3 digit number - //msg2 - $challenge = substr($this->last_reply, 3); - $challenge = base64_decode($challenge); - $ntlm_res = $ntlm_client->NTLMResponse( - substr($challenge, 24, 8), - $password - ); - //msg3 - $msg3 = $ntlm_client->typeMsg3( - $ntlm_res, - $username, - $realm, - $workstation - ); - // send encoded username - return $this->sendCommand('Username', base64_encode($msg3), 235); - case 'CRAM-MD5': - // Start authentication - if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { - return false; - } - // Get the challenge - $challenge = base64_decode(substr($this->last_reply, 4)); - - // Build the response - $response = $username . ' ' . $this->hmac($challenge, $password); - - // send encoded credentials - return $this->sendCommand('Username', base64_encode($response), 235); - default: - $this->setError("Authentication method \"$authtype\" is not supported"); - return false; - } - return true; - } - - /** - * Calculate an MD5 HMAC hash. - * Works like hash_hmac('md5', $data, $key) - * in case that function is not available - * @param string $data The data to hash - * @param string $key The key to hash with - * @access protected - * @return string - */ - protected function hmac($data, $key) - { - if (function_exists('hash_hmac')) { - return hash_hmac('md5', $data, $key); - } - - // The following borrowed from - // http://php.net/manual/en/function.mhash.php#27225 - - // RFC 2104 HMAC implementation for php. - // Creates an md5 HMAC. - // Eliminates the need to install mhash to compute a HMAC - // by Lance Rushing - - $bytelen = 64; // byte length for md5 - if (strlen($key) > $bytelen) { - $key = pack('H*', md5($key)); - } - $key = str_pad($key, $bytelen, chr(0x00)); - $ipad = str_pad('', $bytelen, chr(0x36)); - $opad = str_pad('', $bytelen, chr(0x5c)); - $k_ipad = $key ^ $ipad; - $k_opad = $key ^ $opad; - - return md5($k_opad . pack('H*', md5($k_ipad . $data))); - } - - /** - * Check connection state. - * @access public - * @return boolean True if connected. - */ - public function connected() - { - if (is_resource($this->smtp_conn)) { - $sock_status = stream_get_meta_data($this->smtp_conn); - if ($sock_status['eof']) { - // The socket is valid but we are not connected - $this->edebug( - 'SMTP NOTICE: EOF caught while checking if connected', - self::DEBUG_CLIENT - ); - $this->close(); - return false; - } - return true; // everything looks good - } - return false; - } - - /** - * Close the socket and clean up the state of the class. - * Don't use this function without first trying to use QUIT. - * @see quit() - * @access public - * @return void - */ - public function close() - { - $this->setError(''); - $this->server_caps = null; - $this->helo_rply = null; - if (is_resource($this->smtp_conn)) { - // close the connection and cleanup - fclose($this->smtp_conn); - $this->smtp_conn = null; //Makes for cleaner serialization - $this->edebug('Connection: closed', self::DEBUG_CONNECTION); - } - } - - /** - * Send an SMTP DATA command. - * Issues a data command and sends the msg_data to the server, - * finializing the mail transaction. $msg_data is the message - * that is to be send with the headers. Each header needs to be - * on a single line followed by a with the message headers - * and the message body being separated by and additional . - * Implements rfc 821: DATA - * @param string $msg_data Message data to send - * @access public - * @return boolean - */ - public function data($msg_data) - { - //This will use the standard timelimit - if (!$this->sendCommand('DATA', 'DATA', 354)) { - return false; - } - - /* The server is ready to accept data! - * According to rfc821 we should not send more than 1000 characters on a single line (including the CRLF) - * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into - * smaller lines to fit within the limit. - * We will also look for lines that start with a '.' and prepend an additional '.'. - * NOTE: this does not count towards line-length limit. - */ - - // Normalize line breaks before exploding - $lines = explode("\n", str_replace(array("\r\n", "\r"), "\n", $msg_data)); - - /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field - * of the first line (':' separated) does not contain a space then it _should_ be a header and we will - * process all lines before a blank line as headers. - */ - - $field = substr($lines[0], 0, strpos($lines[0], ':')); - $in_headers = false; - if (!empty($field) && strpos($field, ' ') === false) { - $in_headers = true; - } - - foreach ($lines as $line) { - $lines_out = array(); - if ($in_headers and $line == '') { - $in_headers = false; - } - //Break this line up into several smaller lines if it's too long - //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len), - while (isset($line[self::MAX_LINE_LENGTH])) { - //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on - //so as to avoid breaking in the middle of a word - $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); - //Deliberately matches both false and 0 - if (!$pos) { - //No nice break found, add a hard break - $pos = self::MAX_LINE_LENGTH - 1; - $lines_out[] = substr($line, 0, $pos); - $line = substr($line, $pos); - } else { - //Break at the found point - $lines_out[] = substr($line, 0, $pos); - //Move along by the amount we dealt with - $line = substr($line, $pos + 1); - } - //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 - if ($in_headers) { - $line = "\t" . $line; - } - } - $lines_out[] = $line; - - //Send the lines to the server - foreach ($lines_out as $line_out) { - //RFC2821 section 4.5.2 - if (!empty($line_out) and $line_out[0] == '.') { - $line_out = '.' . $line_out; - } - $this->client_send($line_out . self::CRLF); - } - } - - //Message data has been sent, complete the command - //Increase timelimit for end of DATA command - $savetimelimit = $this->Timelimit; - $this->Timelimit = $this->Timelimit * 2; - $result = $this->sendCommand('DATA END', '.', 250); - //Restore timelimit - $this->Timelimit = $savetimelimit; - return $result; - } - - /** - * Send an SMTP HELO or EHLO command. - * Used to identify the sending server to the receiving server. - * This makes sure that client and server are in a known state. - * Implements RFC 821: HELO - * and RFC 2821 EHLO. - * @param string $host The host name or IP to connect to - * @access public - * @return boolean - */ - public function hello($host = '') - { - //Try extended hello first (RFC 2821) - return (boolean)($this->sendHello('EHLO', $host) or $this->sendHello('HELO', $host)); - } - - /** - * Send an SMTP HELO or EHLO command. - * Low-level implementation used by hello() - * @see hello() - * @param string $hello The HELO string - * @param string $host The hostname to say we are - * @access protected - * @return boolean - */ - protected function sendHello($hello, $host) - { - $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); - $this->helo_rply = $this->last_reply; - if ($noerror) { - $this->parseHelloFields($hello); - } else { - $this->server_caps = null; - } - return $noerror; - } - - /** - * Parse a reply to HELO/EHLO command to discover server extensions. - * In case of HELO, the only parameter that can be discovered is a server name. - * @access protected - * @param string $type - 'HELO' or 'EHLO' - */ - protected function parseHelloFields($type) - { - $this->server_caps = array(); - $lines = explode("\n", $this->helo_rply); - - foreach ($lines as $n => $s) { - //First 4 chars contain response code followed by - or space - $s = trim(substr($s, 4)); - if (empty($s)) { - continue; - } - $fields = explode(' ', $s); - if (!empty($fields)) { - if (!$n) { - $name = $type; - $fields = $fields[0]; - } else { - $name = array_shift($fields); - switch ($name) { - case 'SIZE': - $fields = ($fields ? $fields[0] : 0); - break; - case 'AUTH': - if (!is_array($fields)) { - $fields = array(); - } - break; - default: - $fields = true; - } - } - $this->server_caps[$name] = $fields; - } - } - } - - /** - * Send an SMTP MAIL command. - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more recipient - * commands may be called followed by a data command. - * Implements rfc 821: MAIL FROM: - * @param string $from Source address of this message - * @access public - * @return boolean - */ - public function mail($from) - { - $useVerp = ($this->do_verp ? ' XVERP' : ''); - return $this->sendCommand( - 'MAIL FROM', - 'MAIL FROM:<' . $from . '>' . $useVerp, - 250 - ); - } - - /** - * Send an SMTP QUIT command. - * Closes the socket if there is no error or the $close_on_error argument is true. - * Implements from rfc 821: QUIT - * @param boolean $close_on_error Should the connection close if an error occurs? - * @access public - * @return boolean - */ - public function quit($close_on_error = true) - { - $noerror = $this->sendCommand('QUIT', 'QUIT', 221); - $err = $this->error; //Save any error - if ($noerror or $close_on_error) { - $this->close(); - $this->error = $err; //Restore any error from the quit command - } - return $noerror; - } - - /** - * Send an SMTP RCPT command. - * Sets the TO argument to $toaddr. - * Returns true if the recipient was accepted false if it was rejected. - * Implements from rfc 821: RCPT TO: - * @param string $address The address the message is being sent to - * @access public - * @return boolean - */ - public function recipient($address) - { - return $this->sendCommand( - 'RCPT TO', - 'RCPT TO:<' . $address . '>', - array(250, 251) - ); - } - - /** - * Send an SMTP RSET command. - * Abort any transaction that is currently in progress. - * Implements rfc 821: RSET - * @access public - * @return boolean True on success. - */ - public function reset() - { - return $this->sendCommand('RSET', 'RSET', 250); - } - - /** - * Send a command to an SMTP server and check its return code. - * @param string $command The command name - not sent to the server - * @param string $commandstring The actual command to send - * @param integer|array $expect One or more expected integer success codes - * @access protected - * @return boolean True on success. - */ - protected function sendCommand($command, $commandstring, $expect) - { - if (!$this->connected()) { - $this->setError("Called $command without being connected"); - return false; - } - //Reject line breaks in all commands - if (strpos($commandstring, "\n") !== false or strpos($commandstring, "\r") !== false) { - $this->setError("Command '$command' contained line breaks"); - return false; - } - $this->client_send($commandstring . self::CRLF); - - $this->last_reply = $this->get_lines(); - // Fetch SMTP code and possible error code explanation - $matches = array(); - if (preg_match("/^([0-9]{3})[ -](?:([0-9]\\.[0-9]\\.[0-9]) )?/", $this->last_reply, $matches)) { - $code = $matches[1]; - $code_ex = (count($matches) > 2 ? $matches[2] : null); - // Cut off error code from each response line - $detail = preg_replace( - "/{$code}[ -]" . - ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . "/m", - '', - $this->last_reply - ); - } else { - // Fall back to simple parsing if regex fails - $code = substr($this->last_reply, 0, 3); - $code_ex = null; - $detail = substr($this->last_reply, 4); - } - - $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); - - if (!in_array($code, (array)$expect)) { - $this->setError( - "$command command failed", - $detail, - $code, - $code_ex - ); - $this->edebug( - 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, - self::DEBUG_CLIENT - ); - return false; - } - - $this->setError(''); - return true; - } - - /** - * Send an SMTP SAML command. - * Starts a mail transaction from the email address specified in $from. - * Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more recipient - * commands may be called followed by a data command. This command - * will send the message to the users terminal if they are logged - * in and send them an email. - * Implements rfc 821: SAML FROM: - * @param string $from The address the message is from - * @access public - * @return boolean - */ - public function sendAndMail($from) - { - return $this->sendCommand('SAML', "SAML FROM:$from", 250); - } - - /** - * Send an SMTP VRFY command. - * @param string $name The name to verify - * @access public - * @return boolean - */ - public function verify($name) - { - return $this->sendCommand('VRFY', "VRFY $name", array(250, 251)); - } - - /** - * Send an SMTP NOOP command. - * Used to keep keep-alives alive, doesn't actually do anything - * @access public - * @return boolean - */ - public function noop() - { - return $this->sendCommand('NOOP', 'NOOP', 250); - } - - /** - * Send an SMTP TURN command. - * This is an optional command for SMTP that this class does not support. - * This method is here to make the RFC821 Definition complete for this class - * and _may_ be implemented in future - * Implements from rfc 821: TURN - * @access public - * @return boolean - */ - public function turn() - { - $this->setError('The SMTP TURN command is not implemented'); - $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); - return false; - } - - /** - * Send raw data to the server. - * @param string $data The data to send - * @access public - * @return integer|boolean The number of bytes sent to the server or false on error - */ - public function client_send($data) - { - $this->edebug("CLIENT -> SERVER: $data", self::DEBUG_CLIENT); - return fwrite($this->smtp_conn, $data); - } - - /** - * Get the latest error. - * @access public - * @return array - */ - public function getError() - { - return $this->error; - } - - /** - * Get SMTP extensions available on the server - * @access public - * @return array|null - */ - public function getServerExtList() - { - return $this->server_caps; - } - - /** - * A multipurpose method - * The method works in three ways, dependent on argument value and current state - * 1. HELO/EHLO was not sent - returns null and set up $this->error - * 2. HELO was sent - * $name = 'HELO': returns server name - * $name = 'EHLO': returns boolean false - * $name = any string: returns null and set up $this->error - * 3. EHLO was sent - * $name = 'HELO'|'EHLO': returns server name - * $name = any string: if extension $name exists, returns boolean True - * or its options. Otherwise returns boolean False - * In other words, one can use this method to detect 3 conditions: - * - null returned: handshake was not or we don't know about ext (refer to $this->error) - * - false returned: the requested feature exactly not exists - * - positive value returned: the requested feature exists - * @param string $name Name of SMTP extension or 'HELO'|'EHLO' - * @return mixed - */ - public function getServerExt($name) - { - if (!$this->server_caps) { - $this->setError('No HELO/EHLO was sent'); - return null; - } - - // the tight logic knot ;) - if (!array_key_exists($name, $this->server_caps)) { - if ($name == 'HELO') { - return $this->server_caps['EHLO']; - } - if ($name == 'EHLO' || array_key_exists('EHLO', $this->server_caps)) { - return false; - } - $this->setError('HELO handshake was used. Client knows nothing about server extensions'); - return null; - } - - return $this->server_caps[$name]; - } - - /** - * Get the last reply from the server. - * @access public - * @return string - */ - public function getLastReply() - { - return $this->last_reply; - } - - /** - * Read the SMTP server's response. - * Either before eof or socket timeout occurs on the operation. - * With SMTP we can tell if we have more lines to read if the - * 4th character is '-' symbol. If it is a space then we don't - * need to read anything else. - * @access protected - * @return string - */ - protected function get_lines() - { - // If the connection is bad, give up straight away - if (!is_resource($this->smtp_conn)) { - return ''; - } - $data = ''; - $endtime = 0; - stream_set_timeout($this->smtp_conn, $this->Timeout); - if ($this->Timelimit > 0) { - $endtime = time() + $this->Timelimit; - } - while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { - $str = @fgets($this->smtp_conn, 515); - $this->edebug("SMTP -> get_lines(): \$data is \"$data\"", self::DEBUG_LOWLEVEL); - $this->edebug("SMTP -> get_lines(): \$str is \"$str\"", self::DEBUG_LOWLEVEL); - $data .= $str; - // If 4th character is a space, we are done reading, break the loop, micro-optimisation over strlen - if ((isset($str[3]) and $str[3] == ' ')) { - break; - } - // Timed-out? Log and break - $info = stream_get_meta_data($this->smtp_conn); - if ($info['timed_out']) { - $this->edebug( - 'SMTP -> get_lines(): timed-out (' . $this->Timeout . ' sec)', - self::DEBUG_LOWLEVEL - ); - break; - } - // Now check if reads took too long - if ($endtime and time() > $endtime) { - $this->edebug( - 'SMTP -> get_lines(): timelimit reached (' . - $this->Timelimit . ' sec)', - self::DEBUG_LOWLEVEL - ); - break; - } - } - return $data; - } - - /** - * Enable or disable VERP address generation. - * @param boolean $enabled - */ - public function setVerp($enabled = false) - { - $this->do_verp = $enabled; - } - - /** - * Get VERP address generation mode. - * @return boolean - */ - public function getVerp() - { - return $this->do_verp; - } - - /** - * Set error messages and codes. - * @param string $message The error message - * @param string $detail Further detail on the error - * @param string $smtp_code An associated SMTP error code - * @param string $smtp_code_ex Extended SMTP code - */ - protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') - { - $this->error = array( - 'error' => $message, - 'detail' => $detail, - 'smtp_code' => $smtp_code, - 'smtp_code_ex' => $smtp_code_ex - ); - } - - /** - * Set debug output method. - * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it. - */ - public function setDebugOutput($method = 'echo') - { - $this->Debugoutput = $method; - } - - /** - * Get debug output method. - * @return string - */ - public function getDebugOutput() - { - return $this->Debugoutput; - } - - /** - * Set debug output level. - * @param integer $level - */ - public function setDebugLevel($level = 0) - { - $this->do_debug = $level; - } - - /** - * Get debug output level. - * @return integer - */ - public function getDebugLevel() - { - return $this->do_debug; - } - - /** - * Set SMTP timeout. - * @param integer $timeout - */ - public function setTimeout($timeout = 0) - { - $this->Timeout = $timeout; - } - - /** - * Get SMTP timeout. - * @return integer - */ - public function getTimeout() - { - return $this->Timeout; - } - - /** - * Reports an error number and string. - * @param integer $errno The error number returned by PHP. - * @param string $errmsg The error message returned by PHP. - * @param string $errfile The file the error occurred in - * @param integer $errline The line number the error occurred on - */ - protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0) - { - $notice = 'Connection failed.'; - $this->setError( - $notice, - $errno, - $errmsg - ); - $this->edebug( - $notice . ' Error #' . $errno . ': ' . $errmsg . " [$errfile line $errline]", - self::DEBUG_CONNECTION - ); - } - - /** - * Will return the ID of the last smtp transaction based on a list of patterns provided - * in SMTP::$smtp_transaction_id_patterns. - * If no reply has been received yet, it will return null. - * If no pattern has been matched, it will return false. - * @return bool|null|string - */ - public function getLastTransactionID() - { - $reply = $this->getLastReply(); - - if (empty($reply)) { - return null; - } - - foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { - if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { - return $matches[1]; - } - } - - return false; - } -} diff --git a/app/vendor/phpmailer/phpmailer/COMMITMENT b/app/vendor/phpmailer/phpmailer/COMMITMENT deleted file mode 100644 index a687e0d..0000000 --- a/app/vendor/phpmailer/phpmailer/COMMITMENT +++ /dev/null @@ -1,46 +0,0 @@ -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/app/vendor/phpmailer/phpmailer/LICENSE b/app/vendor/phpmailer/phpmailer/LICENSE deleted file mode 100644 index f166cc5..0000000 --- a/app/vendor/phpmailer/phpmailer/LICENSE +++ /dev/null @@ -1,502 +0,0 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! \ No newline at end of file diff --git a/app/vendor/phpmailer/phpmailer/README.md b/app/vendor/phpmailer/phpmailer/README.md deleted file mode 100644 index fa27d2f..0000000 --- a/app/vendor/phpmailer/phpmailer/README.md +++ /dev/null @@ -1,222 +0,0 @@ -![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) [![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/) - -## 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.0 -- 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.2" -``` - -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_STARTTLS; //Enable TLS encryption; `PHPMailer::ENCRYPTION_SMTPS` encouraged - $mail->Port = 587; //TCP port to connect to, use 465 for `PHPMailer::ENCRYPTION_SMTPS` above - - //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/app/vendor/phpmailer/phpmailer/SECURITY.md b/app/vendor/phpmailer/phpmailer/SECURITY.md deleted file mode 100644 index 035a87f..0000000 --- a/app/vendor/phpmailer/phpmailer/SECURITY.md +++ /dev/null @@ -1,37 +0,0 @@ -# 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/app/vendor/phpmailer/phpmailer/VERSION b/app/vendor/phpmailer/phpmailer/VERSION deleted file mode 100644 index 4be2c72..0000000 --- a/app/vendor/phpmailer/phpmailer/VERSION +++ /dev/null @@ -1 +0,0 @@ -6.5.0 \ No newline at end of file diff --git a/app/vendor/phpmailer/phpmailer/composer.json b/app/vendor/phpmailer/phpmailer/composer.json deleted file mode 100644 index 58393b2..0000000 --- a/app/vendor/phpmailer/phpmailer/composer.json +++ /dev/null @@ -1,65 +0,0 @@ -{ - "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" - } - ], - "require": { - "php": ">=5.5.0", - "ext-ctype": "*", - "ext-filter": "*", - "ext-hash": "*" - }, - "require-dev": { - "dealerdirect/phpcodesniffer-composer-installer": "^0.7.0", - "doctrine/annotations": "^1.2", - "phpcompatibility/php-compatibility": "^9.3.5", - "roave/security-advisories": "dev-latest", - "squizlabs/php_codesniffer": "^3.5.6", - "yoast/phpunit-polyfills": "^0.2.0" - }, - "suggest": { - "ext-mbstring": "Needed to send email in multibyte encoding charset or decode encoded addresses", - "hayageek/oauth2-yahoo": "Needed for Yahoo XOAUTH2 authentication", - "league/oauth2-google": "Needed for Google XOAUTH2 authentication", - "psr/log": "For optional PSR-3 debug logging", - "stevenmaguire/oauth2-microsoft": "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" - } -} diff --git a/app/vendor/phpmailer/phpmailer/get_oauth_token.php b/app/vendor/phpmailer/phpmailer/get_oauth_token.php deleted file mode 100644 index befdc34..0000000 --- a/app/vendor/phpmailer/phpmailer/get_oauth_token.php +++ /dev/null @@ -1,146 +0,0 @@ - - * @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; - -if (!isset($_GET['code']) && !isset($_GET['provider'])) { - ?> - -Select Provider:
-Google
-Yahoo
-Microsoft/Outlook/Hotmail/Live/Office365
- - - $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; -} - -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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php deleted file mode 100644 index 0b2a72d..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-af.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'خطأ SMTP : لا يمكن تأكيد الهوية.'; -$PHPMAILER_LANG['connect_host'] = 'خطأ SMTP: لا يمكن الاتصال بالخادم SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'خطأ SMTP: لم يتم قبول المعلومات .'; -$PHPMAILER_LANG['empty_message'] = 'نص الرسالة فارغ'; -$PHPMAILER_LANG['encoding'] = 'ترميز غير معروف: '; -$PHPMAILER_LANG['execute'] = 'لا يمكن تنفيذ : '; -$PHPMAILER_LANG['file_access'] = 'لا يمكن الوصول للملف: '; -$PHPMAILER_LANG['file_open'] = 'خطأ في الملف: لا يمكن فتحه: '; -$PHPMAILER_LANG['from_failed'] = 'خطأ على مستوى عنوان المرسل : '; -$PHPMAILER_LANG['instantiate'] = 'لا يمكن توفير خدمة البريد.'; -$PHPMAILER_LANG['invalid_address'] = 'الإرسال غير ممكن لأن عنوان البريد الإلكتروني غير صالح: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' برنامج الإرسال غير مدعوم.'; -$PHPMAILER_LANG['provide_address'] = 'يجب توفير عنوان البريد الإلكتروني لمستلم واحد على الأقل.'; -$PHPMAILER_LANG['recipients_failed'] = 'خطأ SMTP: الأخطاء التالية فشل في الارسال لكل من : '; -$PHPMAILER_LANG['signing'] = 'خطأ في التوقيع: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() غير ممكن.'; -$PHPMAILER_LANG['smtp_error'] = 'خطأ على مستوى الخادم SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'لا يمكن تعيين أو إعادة تعيين متغير: '; -$PHPMAILER_LANG['extension_missing'] = 'الإضافة غير موجودة: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php deleted file mode 100644 index 552167e..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-az.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela prijava.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Nije moguće spojiti se sa SMTP serverom.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznata kriptografija: '; -$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 navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedene e-mail adrese nije uspjelo: '; -$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; -$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definišite barem jednu adresu primaoca.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP server nije uspjelo.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP greška: '; -$PHPMAILER_LANG['variable_set'] = 'Nije moguće postaviti varijablu ili je vratiti nazad: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje ekstenzija: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php deleted file mode 100644 index 9e92dda..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-be.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Памылка SMTP: памылка ідэнтыфікацыі.'; -$PHPMAILER_LANG['connect_host'] = 'Памылка SMTP: нельга ўстанавіць сувязь з SMTP-серверам.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Памылка SMTP: звесткі непрынятыя.'; -$PHPMAILER_LANG['empty_message'] = 'Пустое паведамленне.'; -$PHPMAILER_LANG['encoding'] = 'Невядомая кадыроўка тэксту: '; -$PHPMAILER_LANG['execute'] = 'Нельга выканаць каманду: '; -$PHPMAILER_LANG['file_access'] = 'Няма доступу да файла: '; -$PHPMAILER_LANG['file_open'] = 'Нельга адкрыць файл: '; -$PHPMAILER_LANG['from_failed'] = 'Няправільны адрас адпраўніка: '; -$PHPMAILER_LANG['instantiate'] = 'Нельга прымяніць функцыю mail().'; -$PHPMAILER_LANG['invalid_address'] = 'Нельга даслаць паведамленне, няправільны email атрымальніка: '; -$PHPMAILER_LANG['provide_address'] = 'Запоўніце, калі ласка, правільны email атрымальніка.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - паштовы сервер не падтрымліваецца.'; -$PHPMAILER_LANG['recipients_failed'] = 'Памылка SMTP: няправільныя атрымальнікі: '; -$PHPMAILER_LANG['signing'] = 'Памылка подпісу паведамлення: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Памылка сувязі з SMTP-серверам.'; -$PHPMAILER_LANG['smtp_error'] = 'Памылка SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Нельга ўстанавіць або перамяніць значэнне пераменнай: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php deleted file mode 100644 index c41f675..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-bg.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: Не може да се удостовери пред сървъра.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: Не може да се свърже с SMTP хоста.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: данните не са приети.'; -$PHPMAILER_LANG['empty_message'] = 'Съдържанието на съобщението е празно'; -$PHPMAILER_LANG['encoding'] = 'Неизвестно кодиране: '; -$PHPMAILER_LANG['execute'] = 'Не може да се изпълни: '; -$PHPMAILER_LANG['file_access'] = 'Няма достъп до файл: '; -$PHPMAILER_LANG['file_open'] = 'Файлова грешка: Не може да се отвори файл: '; -$PHPMAILER_LANG['from_failed'] = 'Следните адреси за подател са невалидни: '; -$PHPMAILER_LANG['instantiate'] = 'Не може да се инстанцира функцията mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Невалиден адрес: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' - пощенски сървър не се поддържа.'; -$PHPMAILER_LANG['provide_address'] = 'Трябва да предоставите поне един email адрес за получател.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP грешка: Следните адреси за Получател са невалидни: '; -$PHPMAILER_LANG['signing'] = 'Грешка при подписване: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP провален connect().'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP сървърна грешка: '; -$PHPMAILER_LANG['variable_set'] = 'Не може да се установи или възстанови променлива: '; -$PHPMAILER_LANG['extension_missing'] = 'Липсва разширение: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php deleted file mode 100644 index 3468485..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ca.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Error SMTP: No s’ha pogut autenticar.'; -$PHPMAILER_LANG['connect_host'] = 'Error SMTP: No es pot connectar al servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Error SMTP: Dades no acceptades.'; -$PHPMAILER_LANG['empty_message'] = 'El cos del missatge està buit.'; -$PHPMAILER_LANG['encoding'] = 'Codificació desconeguda: '; -$PHPMAILER_LANG['execute'] = 'No es pot executar: '; -$PHPMAILER_LANG['file_access'] = 'No es pot accedir a l’arxiu: '; -$PHPMAILER_LANG['file_open'] = 'Error d’Arxiu: No es pot obrir l’arxiu: '; -$PHPMAILER_LANG['from_failed'] = 'La(s) següent(s) adreces de remitent han fallat: '; -$PHPMAILER_LANG['instantiate'] = 'No s’ha pogut crear una instància de la funció Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Adreça d’email invalida: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no està suportat'; -$PHPMAILER_LANG['provide_address'] = 'S’ha de proveir almenys una adreça d’email com a destinatari.'; -$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Els següents destinataris han fallat: '; -$PHPMAILER_LANG['signing'] = 'Error al signar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Ha fallat el SMTP Connect().'; -$PHPMAILER_LANG['smtp_error'] = 'Error del servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'No s’ha pogut establir o restablir la variable: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php deleted file mode 100644 index 500c952..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ch.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$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['encoding'] = '未知编码:'; -$PHPMAILER_LANG['execute'] = '不能执行: '; -$PHPMAILER_LANG['file_access'] = '不能访问文件:'; -$PHPMAILER_LANG['file_open'] = '文件错误:不能打开文件:'; -$PHPMAILER_LANG['from_failed'] = '下面的发送地址邮件发送失败了: '; -$PHPMAILER_LANG['instantiate'] = '不能实现mail方法。'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' 您所选择的发送邮件的方法并不支持。'; -$PHPMAILER_LANG['provide_address'] = '您必须提供至少一个 收信人的email地址。'; -$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: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php deleted file mode 100644 index e770a1a..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-cs.php +++ /dev/null @@ -1,28 +0,0 @@ - - * 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['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['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 er forkerte: '; -$PHPMAILER_LANG['signing'] = 'Signeringsfejl: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fejlede.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP server fejl: '; -$PHPMAILER_LANG['variable_set'] = 'Kunne ikke definere eller nulstille variablen: '; -$PHPMAILER_LANG['extension_missing'] = 'Udvidelse mangler: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php deleted file mode 100644 index e7e59d2..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-de.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -$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['encoding'] = 'Codificación desconocida: '; -$PHPMAILER_LANG['execute'] = 'Imposible ejecutar: '; -$PHPMAILER_LANG['file_access'] = 'Imposible acceder al archivo: '; -$PHPMAILER_LANG['file_open'] = 'Error de Archivo: Imposible abrir el archivo: '; -$PHPMAILER_LANG['from_failed'] = 'La(s) siguiente(s) direcciones de remitente fallaron: '; -$PHPMAILER_LANG['instantiate'] = 'Imposible crear una instancia de la función Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Imposible enviar: dirección de email inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer no está soportado.'; -$PHPMAILER_LANG['provide_address'] = 'Debe proporcionar al menos una dirección de email de destino.'; -$PHPMAILER_LANG['recipients_failed'] = 'Error SMTP: Los siguientes destinos fallaron: '; -$PHPMAILER_LANG['signing'] = 'Error al firmar: '; -$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: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php deleted file mode 100644 index 93addc9..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-et.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Viga: Autoriseerimise viga.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Viga: Ei õnnestunud luua ühendust SMTP serveriga.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Viga: Vigased andmed.'; -$PHPMAILER_LANG['empty_message'] = 'Tühi kirja sisu'; -$PHPMAILER_LANG["encoding"] = 'Tundmatu kodeering: '; -$PHPMAILER_LANG['execute'] = 'Tegevus ebaõnnestus: '; -$PHPMAILER_LANG['file_access'] = 'Pole piisavalt õiguseid järgneva faili avamiseks: '; -$PHPMAILER_LANG['file_open'] = 'Faili Viga: Faili avamine ebaõnnestus: '; -$PHPMAILER_LANG['from_failed'] = 'Järgnev saatja e-posti aadress on vigane: '; -$PHPMAILER_LANG['instantiate'] = 'mail funktiooni käivitamine ebaõnnestus.'; -$PHPMAILER_LANG['invalid_address'] = 'Saatmine peatatud, e-posti address vigane: '; -$PHPMAILER_LANG['provide_address'] = 'Te peate määrama vähemalt ühe saaja e-posti aadressi.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' maileri tugi puudub.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Viga: Järgnevate saajate e-posti aadressid on vigased: '; -$PHPMAILER_LANG["signing"] = 'Viga allkirjastamisel: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() ebaõnnestus.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP serveri viga: '; -$PHPMAILER_LANG['variable_set'] = 'Ei õnnestunud määrata või lähtestada muutujat: '; -$PHPMAILER_LANG['extension_missing'] = 'Nõutud laiendus on puudu: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php deleted file mode 100644 index 295a47f..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fa.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Mohammad Hossein Mojtahedi - */ - -$PHPMAILER_LANG['authenticate'] = 'خطای SMTP: احراز هویت با شکست مواجه شد.'; -$PHPMAILER_LANG['connect_host'] = 'خطای SMTP: اتصال به سرور SMTP برقرار نشد.'; -$PHPMAILER_LANG['data_not_accepted'] = 'خطای SMTP: داده‌ها نا‌درست هستند.'; -$PHPMAILER_LANG['empty_message'] = 'بخش متن پیام خالی است.'; -$PHPMAILER_LANG['encoding'] = 'کد‌گذاری نا‌شناخته: '; -$PHPMAILER_LANG['execute'] = 'امکان اجرا وجود ندارد: '; -$PHPMAILER_LANG['file_access'] = 'امکان دسترسی به فایل وجود ندارد: '; -$PHPMAILER_LANG['file_open'] = 'خطای File: امکان بازکردن فایل وجود ندارد: '; -$PHPMAILER_LANG['from_failed'] = 'آدرس فرستنده اشتباه است: '; -$PHPMAILER_LANG['instantiate'] = 'امکان معرفی تابع ایمیل وجود ندارد.'; -$PHPMAILER_LANG['invalid_address'] = 'آدرس ایمیل معتبر نیست: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer پشتیبانی نمی‌شود.'; -$PHPMAILER_LANG['provide_address'] = 'باید حداقل یک آدرس گیرنده وارد کنید.'; -$PHPMAILER_LANG['recipients_failed'] = 'خطای SMTP: ارسال به آدرس گیرنده با خطا مواجه شد: '; -$PHPMAILER_LANG['signing'] = 'خطا در امضا: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'خطا در اتصال به SMTP.'; -$PHPMAILER_LANG['smtp_error'] = 'خطا در SMTP Server: '; -$PHPMAILER_LANG['variable_set'] = 'امکان ارسال یا ارسال مجدد متغیر‌ها وجود ندارد: '; -$PHPMAILER_LANG['extension_missing'] = 'افزونه موجود نیست: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php deleted file mode 100644 index 243c054..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fi.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP feilur: Kundi ikki góðkenna.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP feilur: Kundi ikki knýta samband við SMTP vert.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP feilur: Data ikki góðkent.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Ókend encoding: '; -$PHPMAILER_LANG['execute'] = 'Kundi ikki útføra: '; -$PHPMAILER_LANG['file_access'] = 'Kundi ikki tilganga fílu: '; -$PHPMAILER_LANG['file_open'] = 'Fílu feilur: Kundi ikki opna fílu: '; -$PHPMAILER_LANG['from_failed'] = 'fylgjandi Frá/From adressa miseydnaðist: '; -$PHPMAILER_LANG['instantiate'] = 'Kuni ikki instantiera mail funktión.'; -//$PHPMAILER_LANG['invalid_address'] = 'Invalid address: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' er ikki supporterað.'; -$PHPMAILER_LANG['provide_address'] = 'Tú skal uppgeva minst móttakara-emailadressu(r).'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Feilur: Fylgjandi móttakarar miseydnaðust: '; -//$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: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php deleted file mode 100644 index b57f0ec..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-fr.php +++ /dev/null @@ -1,32 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro SMTP: Non puido ser autentificado.'; -$PHPMAILER_LANG['connect_host'] = 'Erro SMTP: Non puido conectar co servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro SMTP: Datos non aceptados.'; -$PHPMAILER_LANG['empty_message'] = 'Corpo da mensaxe vacía'; -$PHPMAILER_LANG['encoding'] = 'Codificación descoñecida: '; -$PHPMAILER_LANG['execute'] = 'Non puido ser executado: '; -$PHPMAILER_LANG['file_access'] = 'Nob puido acceder ó arquivo: '; -$PHPMAILER_LANG['file_open'] = 'Erro de Arquivo: No puido abrir o arquivo: '; -$PHPMAILER_LANG['from_failed'] = 'A(s) seguinte(s) dirección(s) de remitente(s) deron erro: '; -$PHPMAILER_LANG['instantiate'] = 'Non puido crear unha instancia da función Mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Non puido envia-lo correo: dirección de email inválida: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer non está soportado.'; -$PHPMAILER_LANG['provide_address'] = 'Debe engadir polo menos unha dirección de email coma destino.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro SMTP: Os seguintes destinos fallaron: '; -$PHPMAILER_LANG['signing'] = 'Erro ó firmar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro do servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Non puidemos axustar ou reaxustar a variábel: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php deleted file mode 100644 index b123aa5..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-he.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'שגיאת SMTP: פעולת האימות נכשלה.'; -$PHPMAILER_LANG['connect_host'] = 'שגיאת SMTP: לא הצלחתי להתחבר לשרת SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'שגיאת SMTP: מידע לא התקבל.'; -$PHPMAILER_LANG['empty_message'] = 'גוף ההודעה ריק'; -$PHPMAILER_LANG['invalid_address'] = 'כתובת שגויה: '; -$PHPMAILER_LANG['encoding'] = 'קידוד לא מוכר: '; -$PHPMAILER_LANG['execute'] = 'לא הצלחתי להפעיל את: '; -$PHPMAILER_LANG['file_access'] = 'לא ניתן לגשת לקובץ: '; -$PHPMAILER_LANG['file_open'] = 'שגיאת קובץ: לא ניתן לגשת לקובץ: '; -$PHPMAILER_LANG['from_failed'] = 'כתובות הנמענים הבאות נכשלו: '; -$PHPMAILER_LANG['instantiate'] = 'לא הצלחתי להפעיל את פונקציית המייל.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' אינה נתמכת.'; -$PHPMAILER_LANG['provide_address'] = 'חובה לספק לפחות כתובת אחת של מקבל המייל.'; -$PHPMAILER_LANG['recipients_failed'] = 'שגיאת SMTP: הנמענים הבאים נכשלו: '; -$PHPMAILER_LANG['signing'] = 'שגיאת חתימה: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() failed.'; -$PHPMAILER_LANG['smtp_error'] = 'שגיאת שרת SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'לא ניתן לקבוע או לשנות את המשתנה: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php deleted file mode 100644 index d973a35..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hi.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP त्रुटि: प्रामाणिकता की जांच नहीं हो सका। '; -$PHPMAILER_LANG['connect_host'] = 'SMTP त्रुटि: SMTP सर्वर से कनेक्ट नहीं हो सका। '; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP त्रुटि: डेटा स्वीकार नहीं किया जाता है। '; -$PHPMAILER_LANG['empty_message'] = 'संदेश खाली है। '; -$PHPMAILER_LANG['encoding'] = 'अज्ञात एन्कोडिंग प्रकार। '; -$PHPMAILER_LANG['execute'] = 'आदेश को निष्पादित करने में विफल। '; -$PHPMAILER_LANG['file_access'] = 'फ़ाइल उपलब्ध नहीं है। '; -$PHPMAILER_LANG['file_open'] = 'फ़ाइल त्रुटि: फाइल को खोला नहीं जा सका। '; -$PHPMAILER_LANG['from_failed'] = 'प्रेषक का पता गलत है। '; -$PHPMAILER_LANG['instantiate'] = 'मेल फ़ंक्शन कॉल नहीं कर सकता है।'; -$PHPMAILER_LANG['invalid_address'] = 'पता गलत है। '; -$PHPMAILER_LANG['mailer_not_supported'] = 'मेल सर्वर के साथ काम नहीं करता है। '; -$PHPMAILER_LANG['provide_address'] = 'आपको कम से कम एक प्राप्तकर्ता का ई-मेल पता प्रदान करना होगा।'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP त्रुटि: निम्न प्राप्तकर्ताओं को पते भेजने में विफल। '; -$PHPMAILER_LANG['signing'] = 'साइनअप त्रुटि:। '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP का connect () फ़ंक्शन विफल हुआ। '; -$PHPMAILER_LANG['smtp_error'] = 'SMTP सर्वर त्रुटि। '; -$PHPMAILER_LANG['variable_set'] = 'चर को बना या संशोधित नहीं किया जा सकता। '; -$PHPMAILER_LANG['extension_missing'] = 'एक्सटेन्षन गायब है: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php deleted file mode 100644 index cacb6c3..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hr.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Greška: Neuspjela autentikacija.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Greška: Ne mogu se spojiti na SMTP poslužitelj.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Greška: Podatci nisu prihvaćeni.'; -$PHPMAILER_LANG['empty_message'] = 'Sadržaj poruke je prazan.'; -$PHPMAILER_LANG['encoding'] = 'Nepoznati encoding: '; -$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 s navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Greška: Slanje na navedenih e-mail adresa nije uspjelo: '; -$PHPMAILER_LANG['instantiate'] = 'Ne mogu pokrenuti mail funkcionalnost.'; -$PHPMAILER_LANG['invalid_address'] = 'E-mail nije poslan. Neispravna e-mail adresa: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer nije podržan.'; -$PHPMAILER_LANG['provide_address'] = 'Definirajte barem jednu adresu primatelja.'; -$PHPMAILER_LANG['signing'] = 'Greška prilikom prijave: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Spajanje na SMTP poslužitelj nije uspjelo.'; -$PHPMAILER_LANG['smtp_error'] = 'Greška SMTP poslužitelja: '; -$PHPMAILER_LANG['variable_set'] = 'Ne mogu postaviti varijablu niti ju vratiti nazad: '; -$PHPMAILER_LANG['extension_missing'] = 'Nedostaje proširenje: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php deleted file mode 100644 index e6b58b0..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-hu.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP -ի սխալ: չհաջողվեց ստուգել իսկությունը.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP -ի սխալ: չհաջողվեց կապ հաստատել SMTP սերվերի հետ.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP -ի սխալ: տվյալները ընդունված չեն.'; -$PHPMAILER_LANG['empty_message'] = 'Հաղորդագրությունը դատարկ է'; -$PHPMAILER_LANG['encoding'] = 'Կոդավորման անհայտ տեսակ: '; -$PHPMAILER_LANG['execute'] = 'Չհաջողվեց իրականացնել հրամանը: '; -$PHPMAILER_LANG['file_access'] = 'Ֆայլը հասանելի չէ: '; -$PHPMAILER_LANG['file_open'] = 'Ֆայլի սխալ: ֆայլը չհաջողվեց բացել: '; -$PHPMAILER_LANG['from_failed'] = 'Ուղարկողի հետևյալ հասցեն սխալ է: '; -$PHPMAILER_LANG['instantiate'] = 'Հնարավոր չէ կանչել mail ֆունկցիան.'; -$PHPMAILER_LANG['invalid_address'] = 'Հասցեն սխալ է: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' փոստային սերվերի հետ չի աշխատում.'; -$PHPMAILER_LANG['provide_address'] = 'Անհրաժեշտ է տրամադրել գոնե մեկ ստացողի e-mail հասցե.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP -ի սխալ: չի հաջողվել ուղարկել հետևյալ ստացողների հասցեներին: '; -$PHPMAILER_LANG['signing'] = 'Ստորագրման սխալ: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP -ի connect() ֆունկցիան չի հաջողվել'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP սերվերի սխալ: '; -$PHPMAILER_LANG['variable_set'] = 'Չի հաջողվում ստեղծել կամ վերափոխել փոփոխականը: '; -$PHPMAILER_LANG['extension_missing'] = 'Հավելվածը բացակայում է: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php deleted file mode 100644 index 212a11f..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-id.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php deleted file mode 100644 index 08a6b73..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-it.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Stefano Sabatini - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Impossibile autenticarsi.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Impossibile connettersi all\'host SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dati non accettati dal server.'; -$PHPMAILER_LANG['empty_message'] = 'Il corpo del messaggio è vuoto'; -$PHPMAILER_LANG['encoding'] = 'Codifica dei caratteri sconosciuta: '; -$PHPMAILER_LANG['execute'] = 'Impossibile eseguire l\'operazione: '; -$PHPMAILER_LANG['file_access'] = 'Impossibile accedere al file: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Impossibile aprire il file: '; -$PHPMAILER_LANG['from_failed'] = 'I seguenti indirizzi mittenti hanno generato errore: '; -$PHPMAILER_LANG['instantiate'] = 'Impossibile istanziare la funzione mail'; -$PHPMAILER_LANG['invalid_address'] = 'Impossibile inviare, l\'indirizzo email non è valido: '; -$PHPMAILER_LANG['provide_address'] = 'Deve essere fornito almeno un indirizzo ricevente'; -$PHPMAILER_LANG['mailer_not_supported'] = 'Mailer non supportato'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP Error: I seguenti indirizzi destinatari hanno generato un errore: '; -$PHPMAILER_LANG['signing'] = 'Errore nella firma: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() fallita.'; -$PHPMAILER_LANG['smtp_error'] = 'Errore del server SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Impossibile impostare o resettare la variabile: '; -$PHPMAILER_LANG['extension_missing'] = 'Estensione mancante: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php deleted file mode 100644 index eee7989..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ja.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Yoshi Sakai - */ - -$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['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['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: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php deleted file mode 100644 index 51fe403..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ka.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP შეცდომა: ავტორიზაცია შეუძლებელია.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP შეცდომა: SMTP სერვერთან დაკავშირება შეუძლებელია.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP შეცდომა: მონაცემები არ იქნა მიღებული.'; -$PHPMAILER_LANG['encoding'] = 'კოდირების უცნობი ტიპი: '; -$PHPMAILER_LANG['execute'] = 'შეუძლებელია შემდეგი ბრძანების შესრულება: '; -$PHPMAILER_LANG['file_access'] = 'შეუძლებელია წვდომა ფაილთან: '; -$PHPMAILER_LANG['file_open'] = 'ფაილური სისტემის შეცდომა: არ იხსნება ფაილი: '; -$PHPMAILER_LANG['from_failed'] = 'გამგზავნის არასწორი მისამართი: '; -$PHPMAILER_LANG['instantiate'] = 'mail ფუნქციის გაშვება ვერ ხერხდება.'; -$PHPMAILER_LANG['provide_address'] = 'გთხოვთ მიუთითოთ ერთი ადრესატის e-mail მისამართი მაინც.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - საფოსტო სერვერის მხარდაჭერა არ არის.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP შეცდომა: შემდეგ მისამართებზე გაგზავნა ვერ მოხერხდა: '; -$PHPMAILER_LANG['empty_message'] = 'შეტყობინება ცარიელია'; -$PHPMAILER_LANG['invalid_address'] = 'არ გაიგზავნა, e-mail მისამართის არასწორი ფორმატი: '; -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php deleted file mode 100644 index 8c97dd9..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ko.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 오류: 인증할 수 없습니다.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 오류: SMTP 호스트에 접속할 수 없습니다.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 오류: 데이터가 받아들여지지 않았습니다.'; -$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'] = 'mail 함수를 인스턴스화할 수 없습니다'; -$PHPMAILER_LANG['invalid_address'] = '잘못된 주소: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' 메일러는 지원되지 않습니다.'; -$PHPMAILER_LANG['provide_address'] = '적어도 한 개 이상의 수신자 메일 주소를 제공해야 합니다.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 오류: 다음 수신자에서 오류가 발생했습니다: '; -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php deleted file mode 100644 index 4f115b1..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lt.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP klaida: autentifikacija nepavyko.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP klaida: nepavyksta prisijungti prie SMTP stoties.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP klaida: duomenys nepriimti.'; -$PHPMAILER_LANG['empty_message'] = 'Laiško turinys tuščias'; -$PHPMAILER_LANG['encoding'] = 'Neatpažinta koduotė: '; -$PHPMAILER_LANG['execute'] = 'Nepavyko įvykdyti komandos: '; -$PHPMAILER_LANG['file_access'] = 'Byla nepasiekiama: '; -$PHPMAILER_LANG['file_open'] = 'Bylos klaida: Nepavyksta atidaryti: '; -$PHPMAILER_LANG['from_failed'] = 'Neteisingas siuntėjo adresas: '; -$PHPMAILER_LANG['instantiate'] = 'Nepavyko paleisti mail funkcijos.'; -$PHPMAILER_LANG['invalid_address'] = 'Neteisingas adresas: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' pašto stotis nepalaikoma.'; -$PHPMAILER_LANG['provide_address'] = 'Nurodykite bent vieną gavėjo adresą.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP klaida: nepavyko išsiųsti šiems gavėjams: '; -$PHPMAILER_LANG['signing'] = 'Prisijungimo klaida: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP susijungimo klaida'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP stoties klaida: '; -$PHPMAILER_LANG['variable_set'] = 'Nepavyko priskirti reikšmės kintamajam: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php deleted file mode 100644 index 679b18c..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-lv.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP kļūda: Autorizācija neizdevās.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Kļūda: Nevar izveidot savienojumu ar SMTP serveri.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Kļūda: Nepieņem informāciju.'; -$PHPMAILER_LANG['empty_message'] = 'Ziņojuma teksts ir tukšs'; -$PHPMAILER_LANG['encoding'] = 'Neatpazīts kodējums: '; -$PHPMAILER_LANG['execute'] = 'Neizdevās izpildīt komandu: '; -$PHPMAILER_LANG['file_access'] = 'Fails nav pieejams: '; -$PHPMAILER_LANG['file_open'] = 'Faila kļūda: Nevar atvērt failu: '; -$PHPMAILER_LANG['from_failed'] = 'Nepareiza sūtītāja adrese: '; -$PHPMAILER_LANG['instantiate'] = 'Nevar palaist sūtīšanas funkciju.'; -$PHPMAILER_LANG['invalid_address'] = 'Nepareiza adrese: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' sūtītājs netiek atbalstīts.'; -$PHPMAILER_LANG['provide_address'] = 'Lūdzu, norādiet vismaz vienu adresātu.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP kļūda: neizdevās nosūtīt šādiem saņēmējiem: '; -$PHPMAILER_LANG['signing'] = 'Autorizācijas kļūda: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP savienojuma kļūda'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP servera kļūda: '; -$PHPMAILER_LANG['variable_set'] = 'Nevar piešķirt mainīgā vērtību: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php deleted file mode 100644 index 8a94f6a..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-mg.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php deleted file mode 100644 index 71db338..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ms.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Ralat SMTP: Tidak dapat pengesahan.'; -$PHPMAILER_LANG['connect_host'] = 'Ralat SMTP: Tidak dapat menghubungi hos pelayan SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Ralat SMTP: Data tidak diterima oleh pelayan.'; -$PHPMAILER_LANG['empty_message'] = 'Tiada isi untuk mesej'; -$PHPMAILER_LANG['encoding'] = 'Pengekodan tidak diketahui: '; -$PHPMAILER_LANG['execute'] = 'Tidak dapat melaksanakan: '; -$PHPMAILER_LANG['file_access'] = 'Tidak dapat mengakses fail: '; -$PHPMAILER_LANG['file_open'] = 'Ralat Fail: Tidak dapat membuka fail: '; -$PHPMAILER_LANG['from_failed'] = 'Berikut merupakan ralat dari alamat e-mel: '; -$PHPMAILER_LANG['instantiate'] = 'Tidak dapat memberi contoh fungsi e-mel.'; -$PHPMAILER_LANG['invalid_address'] = 'Alamat emel tidak sah: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' jenis penghantar emel tidak disokong.'; -$PHPMAILER_LANG['provide_address'] = 'Anda perlu menyediakan sekurang-kurangnya satu alamat e-mel penerima.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ralat SMTP: Penerima e-mel berikut telah gagal: '; -$PHPMAILER_LANG['signing'] = 'Ralat pada tanda tangan: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() telah gagal.'; -$PHPMAILER_LANG['smtp_error'] = 'Ralat pada pelayan SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Tidak boleh menetapkan atau menetapkan semula pembolehubah: '; -$PHPMAILER_LANG['extension_missing'] = 'Sambungan hilang: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php deleted file mode 100644 index 65793ce..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-nb.php +++ /dev/null @@ -1,26 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP-fout: authenticatie mislukt.'; -$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['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_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_connect_failed'] = 'SMTP Verbinding mislukt.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP-serverfout: '; -$PHPMAILER_LANG['variable_set'] = 'Kan de volgende variabele niet instellen of resetten: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensie afwezig: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php deleted file mode 100644 index 23caa71..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pl.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro do SMTP: Não foi possível realizar a autenticação.'; -$PHPMAILER_LANG['connect_host'] = 'Erro do SMTP: Não foi possível realizar ligação com o servidor SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Erro do SMTP: Os dados foram rejeitados.'; -$PHPMAILER_LANG['empty_message'] = 'A mensagem no e-mail está vazia.'; -$PHPMAILER_LANG['encoding'] = 'Codificação desconhecida: '; -$PHPMAILER_LANG['execute'] = 'Não foi possível executar: '; -$PHPMAILER_LANG['file_access'] = 'Não foi possível aceder o ficheiro: '; -$PHPMAILER_LANG['file_open'] = 'Abertura do ficheiro: Não foi possível abrir o ficheiro: '; -$PHPMAILER_LANG['from_failed'] = 'Ocorreram falhas nos endereços dos seguintes remententes: '; -$PHPMAILER_LANG['instantiate'] = 'Não foi possível iniciar uma instância da função mail.'; -$PHPMAILER_LANG['invalid_address'] = 'Não foi enviado nenhum e-mail para o endereço de e-mail inválido: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer não é suportado.'; -$PHPMAILER_LANG['provide_address'] = 'Tem de fornecer pelo menos um endereço como destinatário do e-mail.'; -$PHPMAILER_LANG['recipients_failed'] = 'Erro do SMTP: O endereço do seguinte destinatário falhou: '; -$PHPMAILER_LANG['signing'] = 'Erro ao assinar: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() falhou.'; -$PHPMAILER_LANG['smtp_error'] = 'Erro de servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão em falta: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php deleted file mode 100644 index d863809..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-pt_br.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @author Lucas Guimarães - * @author Phelipe Alves - * @author Fabio Beneditto - */ - -$PHPMAILER_LANG['authenticate'] = 'Erro de SMTP: Não foi possível autenticar.'; -$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['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['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_error'] = 'Erro de servidor SMTP: '; -$PHPMAILER_LANG['variable_set'] = 'Não foi possível definir ou redefinir a variável: '; -$PHPMAILER_LANG['extension_missing'] = 'Extensão não existe: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php deleted file mode 100644 index 292ec1e..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ro.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Eroare SMTP: Autentificarea a eșuat.'; -$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['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['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_connect_failed'] = 'Conectarea la serverul SMTP a eșuat.'; -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php deleted file mode 100644 index 8c8c5e8..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-ru.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Foster Snowhill - */ - -$PHPMAILER_LANG['authenticate'] = 'Ошибка SMTP: ошибка авторизации.'; -$PHPMAILER_LANG['connect_host'] = 'Ошибка SMTP: не удается подключиться к SMTP-серверу.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Ошибка SMTP: данные не приняты.'; -$PHPMAILER_LANG['encoding'] = 'Неизвестная кодировка: '; -$PHPMAILER_LANG['execute'] = 'Невозможно выполнить команду: '; -$PHPMAILER_LANG['file_access'] = 'Нет доступа к файлу: '; -$PHPMAILER_LANG['file_open'] = 'Файловая ошибка: не удаётся открыть файл: '; -$PHPMAILER_LANG['from_failed'] = 'Неверный адрес отправителя: '; -$PHPMAILER_LANG['instantiate'] = 'Невозможно запустить функцию mail().'; -$PHPMAILER_LANG['provide_address'] = 'Пожалуйста, введите хотя бы один email-адрес получателя.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' — почтовый сервер не поддерживается.'; -$PHPMAILER_LANG['recipients_failed'] = 'Ошибка SMTP: не удалась отправка таким адресатам: '; -$PHPMAILER_LANG['empty_message'] = 'Пустое сообщение'; -$PHPMAILER_LANG['invalid_address'] = 'Не отправлено из-за неправильного формата email-адреса: '; -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php deleted file mode 100644 index 028f5bc..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sk.php +++ /dev/null @@ -1,30 +0,0 @@ - - * @author Peter Orlický - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP Error: Chyba autentifikácie.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP Error: Nebolo možné nadviazať spojenie so SMTP serverom.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP Error: Dáta neboli prijaté'; -$PHPMAILER_LANG['empty_message'] = 'Prázdne telo správy.'; -$PHPMAILER_LANG['encoding'] = 'Neznáme kódovanie: '; -$PHPMAILER_LANG['execute'] = 'Nedá sa vykonať: '; -$PHPMAILER_LANG['file_access'] = 'Súbor nebol nájdený: '; -$PHPMAILER_LANG['file_open'] = 'File Error: Súbor sa otvoriť pre čítanie: '; -$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 '; -$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'] = 'Chýba rozšírenie: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php deleted file mode 100644 index c437a88..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sl.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @author Filip Š - * @author Blaž Oražem - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP napaka: Avtentikacija ni uspela.'; -$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['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_hostentry'] = 'Neveljaven vnos gostitelja: '; -$PHPMAILER_LANG['invalid_host'] = 'Neveljaven gostitelj: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer ni podprt.'; -$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_connect_failed'] = 'Ne morem vzpostaviti povezave s SMTP strežnikom.'; -$PHPMAILER_LANG['smtp_error'] = 'Napaka SMTP strežnika: '; -$PHPMAILER_LANG['variable_set'] = 'Ne morem nastaviti oz. ponastaviti spremenljivke: '; -$PHPMAILER_LANG['extension_missing'] = 'Manjkajoča razširitev: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php deleted file mode 100644 index 0b5280f..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @author Miloš Milanović - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP грешка: аутентификација није успела.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP грешка: повезивање са SMTP сервером није успело.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP грешка: подаци нису прихваћени.'; -$PHPMAILER_LANG['empty_message'] = 'Садржај поруке је празан.'; -$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['mailer_not_supported'] = ' мејлер није подржан.'; -$PHPMAILER_LANG['provide_address'] = 'Дефинишите бар једну адресу примаоца.'; -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php deleted file mode 100644 index 6213832..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sr_latn.php +++ /dev/null @@ -1,28 +0,0 @@ - - * @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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php deleted file mode 100644 index 9872c19..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-sv.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP fel: Kunde inte autentisera.'; -$PHPMAILER_LANG['connect_host'] = 'SMTP fel: Kunde inte ansluta till SMTP-server.'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP fel: Data accepterades inte.'; -//$PHPMAILER_LANG['empty_message'] = 'Message body empty'; -$PHPMAILER_LANG['encoding'] = 'Okänt encode-format: '; -$PHPMAILER_LANG['execute'] = 'Kunde inte köra: '; -$PHPMAILER_LANG['file_access'] = 'Ingen åtkomst till fil: '; -$PHPMAILER_LANG['file_open'] = 'Fil fel: Kunde inte öppna fil: '; -$PHPMAILER_LANG['from_failed'] = 'Följande avsändaradress är felaktig: '; -$PHPMAILER_LANG['instantiate'] = 'Kunde inte initiera e-postfunktion.'; -$PHPMAILER_LANG['invalid_address'] = 'Felaktig adress: '; -$PHPMAILER_LANG['provide_address'] = 'Du måste ange minst en mottagares e-postadress.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' mailer stöds inte.'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP fel: Följande mottagare är felaktig: '; -$PHPMAILER_LANG['signing'] = 'Signeringsfel: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP Connect() misslyckades.'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP serverfel: '; -$PHPMAILER_LANG['variable_set'] = 'Kunde inte definiera eller återställa variabel: '; -$PHPMAILER_LANG['extension_missing'] = 'Tillägg ej tillgängligt: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php deleted file mode 100644 index d15bed1..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tl.php +++ /dev/null @@ -1,28 +0,0 @@ - - */ - -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php deleted file mode 100644 index f938f80..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-tr.php +++ /dev/null @@ -1,31 +0,0 @@ - - * @fixed by Boris Yurchenko - */ - -$PHPMAILER_LANG['authenticate'] = 'Помилка SMTP: помилка авторизації.'; -$PHPMAILER_LANG['connect_host'] = 'Помилка SMTP: не вдається під\'єднатися до SMTP-серверу.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Помилка SMTP: дані не прийнято.'; -$PHPMAILER_LANG['encoding'] = 'Невідоме кодування: '; -$PHPMAILER_LANG['execute'] = 'Неможливо виконати команду: '; -$PHPMAILER_LANG['file_access'] = 'Немає доступу до файлу: '; -$PHPMAILER_LANG['file_open'] = 'Помилка файлової системи: не вдається відкрити файл: '; -$PHPMAILER_LANG['from_failed'] = 'Невірна адреса відправника: '; -$PHPMAILER_LANG['instantiate'] = 'Неможливо запустити функцію mail().'; -$PHPMAILER_LANG['provide_address'] = 'Будь ласка, введіть хоча б одну email-адресу отримувача.'; -$PHPMAILER_LANG['mailer_not_supported'] = ' - поштовий сервер не підтримується.'; -$PHPMAILER_LANG['recipients_failed'] = 'Помилка SMTP: не вдалося відправлення для таких отримувачів: '; -$PHPMAILER_LANG['empty_message'] = 'Пусте повідомлення'; -$PHPMAILER_LANG['invalid_address'] = 'Не відправлено через неправильний формат email-адреси: '; -$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/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php deleted file mode 100644 index d65576e..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-vi.php +++ /dev/null @@ -1,27 +0,0 @@ - - */ - -$PHPMAILER_LANG['authenticate'] = 'Lỗi SMTP: Không thể xác thực.'; -$PHPMAILER_LANG['connect_host'] = 'Lỗi SMTP: Không thể kết nối máy chủ SMTP.'; -$PHPMAILER_LANG['data_not_accepted'] = 'Lỗi SMTP: Dữ liệu không được chấp nhận.'; -$PHPMAILER_LANG['empty_message'] = 'Không có nội dung'; -$PHPMAILER_LANG['encoding'] = 'Mã hóa không xác định: '; -$PHPMAILER_LANG['execute'] = 'Không thực hiện được: '; -$PHPMAILER_LANG['file_access'] = 'Không thể truy cập tệp tin '; -$PHPMAILER_LANG['file_open'] = 'Lỗi Tập tin: Không thể mở tệp tin: '; -$PHPMAILER_LANG['from_failed'] = 'Lỗi địa chỉ gửi đi: '; -$PHPMAILER_LANG['instantiate'] = 'Không dùng được các hàm gửi thư.'; -$PHPMAILER_LANG['invalid_address'] = 'Đại chỉ emai không đúng: '; -$PHPMAILER_LANG['mailer_not_supported'] = ' trình gửi thư không được hỗ trợ.'; -$PHPMAILER_LANG['provide_address'] = 'Bạn phải cung cấp ít nhất một địa chỉ người nhận.'; -$PHPMAILER_LANG['recipients_failed'] = 'Lỗi SMTP: lỗi địa chỉ người nhận: '; -$PHPMAILER_LANG['signing'] = 'Lỗi đăng nhập: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'Lỗi kết nối với SMTP'; -$PHPMAILER_LANG['smtp_error'] = 'Lỗi máy chủ smtp '; -$PHPMAILER_LANG['variable_set'] = 'Không thể thiết lập hoặc thiết lập lại biến: '; -//$PHPMAILER_LANG['extension_missing'] = 'Extension missing: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php deleted file mode 100644 index 35e4e70..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @author Peter Dave Hello <@PeterDaveHello/> - * @author Jason Chiang - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 錯誤:登入失敗。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 錯誤:無法連線到 SMTP 主機。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 錯誤:無法接受的資料。'; -$PHPMAILER_LANG['empty_message'] = '郵件內容為空'; -$PHPMAILER_LANG['encoding'] = '未知編碼: '; -$PHPMAILER_LANG['execute'] = '無法執行:'; -$PHPMAILER_LANG['file_access'] = '無法存取檔案:'; -$PHPMAILER_LANG['file_open'] = '檔案錯誤:無法開啟檔案:'; -$PHPMAILER_LANG['from_failed'] = '發送地址錯誤:'; -$PHPMAILER_LANG['instantiate'] = '未知函數呼叫。'; -$PHPMAILER_LANG['invalid_address'] = '因為電子郵件地址無效,無法傳送: '; -$PHPMAILER_LANG['mailer_not_supported'] = '不支援的發信客戶端。'; -$PHPMAILER_LANG['provide_address'] = '必須提供至少一個收件人地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 錯誤:以下收件人地址錯誤:'; -$PHPMAILER_LANG['signing'] = '電子簽章錯誤: '; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP 連線失敗'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP 伺服器錯誤: '; -$PHPMAILER_LANG['variable_set'] = '無法設定或重設變數: '; -$PHPMAILER_LANG['extension_missing'] = '遺失模組 Extension: '; diff --git a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php b/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php deleted file mode 100644 index 728a499..0000000 --- a/app/vendor/phpmailer/phpmailer/language/phpmailer.lang-zh_cn.php +++ /dev/null @@ -1,29 +0,0 @@ - - * @author young - * @author Teddysun - */ - -$PHPMAILER_LANG['authenticate'] = 'SMTP 错误:登录失败。'; -$PHPMAILER_LANG['connect_host'] = 'SMTP 错误:无法连接到 SMTP 主机。'; -$PHPMAILER_LANG['data_not_accepted'] = 'SMTP 错误:数据不被接受。'; -$PHPMAILER_LANG['empty_message'] = '邮件正文为空。'; -$PHPMAILER_LANG['encoding'] = '未知编码:'; -$PHPMAILER_LANG['execute'] = '无法执行:'; -$PHPMAILER_LANG['file_access'] = '无法访问文件:'; -$PHPMAILER_LANG['file_open'] = '文件错误:无法打开文件:'; -$PHPMAILER_LANG['from_failed'] = '发送地址错误:'; -$PHPMAILER_LANG['instantiate'] = '未知函数调用。'; -$PHPMAILER_LANG['invalid_address'] = '发送失败,电子邮箱地址是无效的:'; -$PHPMAILER_LANG['mailer_not_supported'] = '发信客户端不被支持。'; -$PHPMAILER_LANG['provide_address'] = '必须提供至少一个收件人地址。'; -$PHPMAILER_LANG['recipients_failed'] = 'SMTP 错误:收件人地址错误:'; -$PHPMAILER_LANG['signing'] = '登录失败:'; -$PHPMAILER_LANG['smtp_connect_failed'] = 'SMTP服务器连接失败。'; -$PHPMAILER_LANG['smtp_error'] = 'SMTP服务器出错:'; -$PHPMAILER_LANG['variable_set'] = '无法设置或重置变量:'; -$PHPMAILER_LANG['extension_missing'] = '丢失模块 Extension:'; diff --git a/app/vendor/phpmailer/phpmailer/phpunit.xml.dist b/app/vendor/phpmailer/phpmailer/phpunit.xml.dist deleted file mode 100644 index c68df96..0000000 --- a/app/vendor/phpmailer/phpmailer/phpunit.xml.dist +++ /dev/null @@ -1,35 +0,0 @@ - - - - - ./test/ - - - - - - - - languages - pop3 - - - - - ./src - - - - - - - - diff --git a/app/vendor/phpmailer/phpmailer/src/Exception.php b/app/vendor/phpmailer/phpmailer/src/Exception.php deleted file mode 100644 index a50a899..0000000 --- a/app/vendor/phpmailer/phpmailer/src/Exception.php +++ /dev/null @@ -1,40 +0,0 @@ - - * @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()) . "
\n"; - } -} diff --git a/app/vendor/phpmailer/phpmailer/src/OAuth.php b/app/vendor/phpmailer/phpmailer/src/OAuth.php deleted file mode 100644 index c93d0be..0000000 --- a/app/vendor/phpmailer/phpmailer/src/OAuth.php +++ /dev/null @@ -1,139 +0,0 @@ - - * @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 -{ - /** - * 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/app/vendor/phpmailer/phpmailer/src/PHPMailer.php b/app/vendor/phpmailer/phpmailer/src/PHPMailer.php deleted file mode 100644 index eb4b742..0000000 --- a/app/vendor/phpmailer/phpmailer/src/PHPMailer.php +++ /dev/null @@ -1,4970 +0,0 @@ - - * @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 = 'root@localhost'; - - /** - * The From name of the message. - * - * @var string - */ - public $FromName = 'Root User'; - - /** - * 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 auth type. - * Options are CRAM-MD5, LOGIN, PLAIN, XOAUTH2, attempted in that order if not specified. - * - * @var string - */ - public $AuthType = ''; - - /** - * An instance of the PHPMailer OAuth class. - * - * @var OAuth - */ - 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 languages. - * - * @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.5.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 (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 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 addOrEnqueueAnAddress($kind, $address, $name) - { - $address = trim($address); - $name = trim(preg_replace('/[\r\n]+/', '', $name)); //Strip breaks and trim - $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; - } - $params = [$kind, $address, $name]; - //Enqueue addresses with IDN until we know the PHPMailer::$CharSet. - 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); - } - - /** - * 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 - * - * @return array - */ - public static function parseAddresses($addrstr, $useimap = true) - { - $addresses = []; - if ($useimap && function_exists('imap_rfc822_parse_adrlist')) { - //Use this built-in parser if it's available - $list = imap_rfc822_parse_adrlist($addrstr, ''); - 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') && - extension_loaded('mbstring') && - preg_match('/^=\?.*\?=$/', $address->personal) - ) { - $address->personal = mb_decode_mimeheader($address->personal); - } - - $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)) { - //If this name is encoded, decode it - if (preg_match('/^=\?.*\?=$/', $name)) { - $name = mb_decode_mimeheader($name); - } - $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($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, $errorcode, \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( - '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+.', - 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) { - if ($this->Mailer === 'smtp' && $this->SMTPKeepAlive == true) { - $this->smtp->reset(); - } - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - 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 - if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { - //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); - $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) - { - //Future-proof - 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 = file_exists($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 = implode(', ', $toArr); - - $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. - if (empty($this->Sender) && !empty(ini_get('sendmail_from'))) { - //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); - $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); - $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()) { - throw new Exception($this->lang('connect_host')); - } - //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; - } - - 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. - * Returns false if it cannot load the language file. - * The default language is English. - * - * @param string $langcode ISO 639-1 2-character language code (e.g. French is "fr") - * @param string $lang_path Path to the language file directory, with trailing separator (slash).D - * Do not set this from user input! - * - * @return bool - */ - 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.', - '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: ', - '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_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_connect_failed' => 'SMTP connect() failed.', - 'smtp_error' => 'SMTP server error: ', - 'variable_set' => 'Cannot set or reset variable: ', - 'extension_missing' => 'Extension missing: ', - ]; - 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 - if (!preg_match('/^[a-z]{2}(?:_[a-zA-Z]{2})?$/', $langcode)) { - $langcode = 'en'; - } - $foundlang = true; - $lang_file = $lang_path . 'phpmailer.lang-' . $langcode . '.php'; - //There is no English translation file - if ('en' !== $langcode) { - //Make sure language file path is readable - if (!static::fileIsAccessible($lang_file)) { - $foundlang = false; - } else { - //$foundlang = include $lang_file; - $lines = file($lang_file); - foreach ($lines as $line) { - //Translation file lines look like this: - //$PHPMAILER_LANG['authenticate'] = 'SMTP-Fehler: Authentifizierung fehlgeschlagen.'; - //These files are parsed as text and not PHP so as to avoid the possibility of code injection - //See https://blog.stevenlevithan.com/archives/match-quoted-string - $matches = []; - if ( - preg_match( - '/^\$PHPMAILER_LANG\[\'([a-z\d_]+)\'\]\s*=\s*(["\'])(.+)*?\2;/', - $line, - $matches - ) && - //Ignore unknown translation keys - array_key_exists($matches[1], $PHPMAILER_LANG) - ) { - //Overwrite language-specific strings so we'll never have missing translation keys. - $PHPMAILER_LANG[$matches[1]] = (string)$matches[3]; - } - } - } - } - $this->language = $PHPMAILER_LANG; - - return $foundlang; //Returns false if language not found - } - - /** - * Get the array of strings for the current language. - * - * @return array - */ - public function getTranslations() - { - return $this->language; - } - - /** - * Create recipient headers. - * - * @param string $type - * @param array $addr An array of recipients, - * where each recipient is a 2-element indexed array with element 0 containing an address - * and element 1 containing a name, like: - * [['joe@example.com', 'Joe User'], ['zoe@example.com', 'Zoe User']] - * - * @return string - */ - public function addrAppend($type, $addr) - { - $addresses = []; - foreach ($addr as $address) { - $addresses[] = $this->addrFormat($address); - } - - return $type . ': ' . implode(', ', $addresses) . static::$LE; - } - - /** - * Format an address for use in a message header. - * - * @param array $addr A 2-element indexed array, element 0 containing an address, element 1 containing a name like - * ['joe@example.com', 'Joe User'] - * - * @return string - */ - public function addrFormat($addr) - { - if (empty($addr[1])) { //No name provided - return $this->secureHeader($addr[0]); - } - - return $this->encodeHeader($this->secureHeader($addr[1]), 'phrase') . - ' <' . $this->secureHeader($addr[0]) . '>'; - } - - /** - * Word-wrap message. - * For use with mailers that do not automatically perform wrapping - * and for quoted-printable encoded messages. - * Original written by philippe. - * - * @param string $message The message to wrap - * @param int $length The line length to wrap to - * @param bool $qp_mode Whether to run in Quoted-Printable mode - * - * @return string - */ - public function wrapText($message, $length, $qp_mode = false) - { - if ($qp_mode) { - $soft_break = sprintf(' =%s', static::$LE); - } else { - $soft_break = static::$LE; - } - //If utf-8 encoding is used, we will need to make sure we don't - //split multibyte characters when we wrap - $is_utf8 = static::CHARSET_UTF8 === strtolower($this->CharSet); - $lelen = strlen(static::$LE); - $crlflen = strlen(static::$LE); - - $message = static::normalizeBreaks($message); - //Remove a trailing line break - if (substr($message, -$lelen) === static::$LE) { - $message = substr($message, 0, -$lelen); - } - - //Split message into lines - $lines = explode(static::$LE, $message); - //Message will be rebuilt in here - $message = ''; - foreach ($lines as $line) { - $words = explode(' ', $line); - $buf = ''; - $firstword = true; - foreach ($words as $word) { - if ($qp_mode && (strlen($word) > $length)) { - $space_left = $length - strlen($buf) - $crlflen; - if (!$firstword) { - if ($space_left > 20) { - $len = $space_left; - if ($is_utf8) { - $len = $this->utf8CharBoundary($word, $len); - } elseif ('=' === substr($word, $len - 1, 1)) { - --$len; - } elseif ('=' === substr($word, $len - 2, 1)) { - $len -= 2; - } - $part = substr($word, 0, $len); - $word = substr($word, $len); - $buf .= ' ' . $part; - $message .= $buf . sprintf('=%s', static::$LE); - } else { - $message .= $buf . $soft_break; - } - $buf = ''; - } - while ($word !== '') { - if ($length <= 0) { - break; - } - $len = $length; - if ($is_utf8) { - $len = $this->utf8CharBoundary($word, $len); - } elseif ('=' === substr($word, $len - 1, 1)) { - --$len; - } elseif ('=' === substr($word, $len - 2, 1)) { - $len -= 2; - } - $part = substr($word, 0, $len); - $word = (string) substr($word, $len); - - if ($word !== '') { - $message .= $part . sprintf('=%s', static::$LE); - } else { - $buf = $part; - } - } - } else { - $buf_o = $buf; - if (!$firstword) { - $buf .= ' '; - } - $buf .= $word; - - if ('' !== $buf_o && strlen($buf) > $length) { - $message .= $buf_o . $soft_break; - $buf = $word; - } - } - $firstword = false; - } - $message .= $buf . static::$LE; - } - - return $message; - } - - /** - * Find the last character boundary prior to $maxLength in a utf-8 - * quoted-printable encoded string. - * Original written by Colin Brown. - * - * @param string $encodedText utf-8 QP text - * @param int $maxLength Find the last character boundary prior to this length - * - * @return int - */ - public function utf8CharBoundary($encodedText, $maxLength) - { - $foundSplitPos = false; - $lookBack = 3; - while (!$foundSplitPos) { - $lastChunk = substr($encodedText, $maxLength - $lookBack, $lookBack); - $encodedCharPos = strpos($lastChunk, '='); - if (false !== $encodedCharPos) { - //Found start of encoded character byte within $lookBack block. - //Check the encoded byte value (the 2 chars after the '=') - $hex = substr($encodedText, $maxLength - $lookBack + $encodedCharPos + 1, 2); - $dec = hexdec($hex); - if ($dec < 128) { - //Single byte character. - //If the encoded char was found at pos 0, it will fit - //otherwise reduce maxLength to start of the encoded char - if ($encodedCharPos > 0) { - $maxLength -= $lookBack - $encodedCharPos; - } - $foundSplitPos = true; - } elseif ($dec >= 192) { - //First byte of a multi byte character - //Reduce maxLength to split at start of character - $maxLength -= $lookBack - $encodedCharPos; - $foundSplitPos = true; - } elseif ($dec < 192) { - //Middle byte of a multi byte character, look further back - $lookBack += 3; - } - } else { - //No encoded character found - $foundSplitPos = true; - } - } - - return $maxLength; - } - - /** - * Apply word wrapping to the message body. - * Wraps the message body to the number of chars set in the WordWrap property. - * You should only do this to plain-text bodies as wrapping HTML tags may break them. - * This is called automatically by createBody(), so you don't need to call it yourself. - */ - public function setWordWrap() - { - if ($this->WordWrap < 1) { - return; - } - - switch ($this->message_type) { - case 'alt': - case 'alt_inline': - case 'alt_attach': - case 'alt_inline_attach': - $this->AltBody = $this->wrapText($this->AltBody, $this->WordWrap); - break; - default: - $this->Body = $this->wrapText($this->Body, $this->WordWrap); - break; - } - } - - /** - * Assemble message headers. - * - * @return string The assembled headers - */ - public function createHeader() - { - $result = ''; - - $result .= $this->headerLine('Date', '' === $this->MessageDate ? self::rfcDate() : $this->MessageDate); - - //The To header is created automatically by mail(), so needs to be omitted here - if ('mail' !== $this->Mailer) { - if ($this->SingleTo) { - foreach ($this->to as $toaddr) { - $this->SingleToArray[] = $this->addrFormat($toaddr); - } - } elseif (count($this->to) > 0) { - $result .= $this->addrAppend('To', $this->to); - } elseif (count($this->cc) === 0) { - $result .= $this->headerLine('To', 'undisclosed-recipients:;'); - } - } - $result .= $this->addrAppend('From', [[trim($this->From), $this->FromName]]); - - //sendmail and mail() extract Cc from the header before sending - if (count($this->cc) > 0) { - $result .= $this->addrAppend('Cc', $this->cc); - } - - //sendmail and mail() extract Bcc from the header before sending - if ( - ( - 'sendmail' === $this->Mailer || 'qmail' === $this->Mailer || 'mail' === $this->Mailer - ) - && count($this->bcc) > 0 - ) { - $result .= $this->addrAppend('Bcc', $this->bcc); - } - - if (count($this->ReplyTo) > 0) { - $result .= $this->addrAppend('Reply-To', $this->ReplyTo); - } - - //mail() sets the subject itself - if ('mail' !== $this->Mailer) { - $result .= $this->headerLine('Subject', $this->encodeHeader($this->secureHeader($this->Subject))); - } - - //Only allow a custom message ID if it conforms to RFC 5322 section 3.6.4 - //https://tools.ietf.org/html/rfc5322#section-3.6.4 - if ('' !== $this->MessageID && preg_match('/^<.*@.*>$/', $this->MessageID)) { - $this->lastMessageID = $this->MessageID; - } else { - $this->lastMessageID = sprintf('<%s@%s>', $this->uniqueid, $this->serverHostname()); - } - $result .= $this->headerLine('Message-ID', $this->lastMessageID); - if (null !== $this->Priority) { - $result .= $this->headerLine('X-Priority', $this->Priority); - } - if ('' === $this->XMailer) { - $result .= $this->headerLine( - 'X-Mailer', - 'PHPMailer ' . self::VERSION . ' (https://github.com/PHPMailer/PHPMailer)' - ); - } else { - $myXmailer = trim($this->XMailer); - if ($myXmailer) { - $result .= $this->headerLine('X-Mailer', $myXmailer); - } - } - - if ('' !== $this->ConfirmReadingTo) { - $result .= $this->headerLine('Disposition-Notification-To', '<' . $this->ConfirmReadingTo . '>'); - } - - //Add custom headers - foreach ($this->CustomHeader as $header) { - $result .= $this->headerLine( - trim($header[0]), - $this->encodeHeader(trim($header[1])) - ); - } - if (!$this->sign_key_file) { - $result .= $this->headerLine('MIME-Version', '1.0'); - $result .= $this->getMailMIME(); - } - - return $result; - } - - /** - * Get the message MIME type headers. - * - * @return string - */ - public function getMailMIME() - { - $result = ''; - $ismultipart = true; - switch ($this->message_type) { - case 'inline': - $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); - $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); - break; - case 'attach': - case 'inline_attach': - case 'alt_attach': - case 'alt_inline_attach': - $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_MIXED . ';'); - $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); - break; - case 'alt': - case 'alt_inline': - $result .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); - $result .= $this->textLine(' boundary="' . $this->boundary[1] . '"'); - break; - default: - //Catches case 'plain': and case '': - $result .= $this->textLine('Content-Type: ' . $this->ContentType . '; charset=' . $this->CharSet); - $ismultipart = false; - break; - } - //RFC1341 part 5 says 7bit is assumed if not specified - if (static::ENCODING_7BIT !== $this->Encoding) { - //RFC 2045 section 6.4 says multipart MIME parts may only use 7bit, 8bit or binary CTE - if ($ismultipart) { - if (static::ENCODING_8BIT === $this->Encoding) { - $result .= $this->headerLine('Content-Transfer-Encoding', static::ENCODING_8BIT); - } - //The only remaining alternatives are quoted-printable and base64, which are both 7bit compatible - } else { - $result .= $this->headerLine('Content-Transfer-Encoding', $this->Encoding); - } - } - - return $result; - } - - /** - * Returns the whole MIME message. - * Includes complete headers and body. - * Only valid post preSend(). - * - * @see PHPMailer::preSend() - * - * @return string - */ - public function getSentMIMEMessage() - { - return static::stripTrailingWSP($this->MIMEHeader . $this->mailHeader) . - static::$LE . static::$LE . $this->MIMEBody; - } - - /** - * Create a unique ID to use for boundaries. - * - * @return string - */ - protected function generateId() - { - $len = 32; //32 bytes = 256 bits - $bytes = ''; - if (function_exists('random_bytes')) { - try { - $bytes = random_bytes($len); - } catch (\Exception $e) { - //Do nothing - } - } elseif (function_exists('openssl_random_pseudo_bytes')) { - /** @noinspection CryptographicallySecureRandomnessInspection */ - $bytes = openssl_random_pseudo_bytes($len); - } - if ($bytes === '') { - //We failed to produce a proper random string, so make do. - //Use a hash to force the length to the same as the other methods - $bytes = hash('sha256', uniqid((string) mt_rand(), true), true); - } - - //We don't care about messing up base64 format here, just want a random string - return str_replace(['=', '+', '/'], '', base64_encode(hash('sha256', $bytes, true))); - } - - /** - * Assemble the message body. - * Returns an empty string on failure. - * - * @throws Exception - * - * @return string The assembled message body - */ - public function createBody() - { - $body = ''; - //Create unique IDs and preset boundaries - $this->uniqueid = $this->generateId(); - $this->boundary[1] = 'b1_' . $this->uniqueid; - $this->boundary[2] = 'b2_' . $this->uniqueid; - $this->boundary[3] = 'b3_' . $this->uniqueid; - - if ($this->sign_key_file) { - $body .= $this->getMailMIME() . static::$LE; - } - - $this->setWordWrap(); - - $bodyEncoding = $this->Encoding; - $bodyCharSet = $this->CharSet; - //Can we do a 7-bit downgrade? - if (static::ENCODING_8BIT === $bodyEncoding && !$this->has8bitChars($this->Body)) { - $bodyEncoding = static::ENCODING_7BIT; - //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit - $bodyCharSet = static::CHARSET_ASCII; - } - //If lines are too long, and we're not already using an encoding that will shorten them, - //change to quoted-printable transfer encoding for the body part only - if (static::ENCODING_BASE64 !== $this->Encoding && static::hasLineLongerThanMax($this->Body)) { - $bodyEncoding = static::ENCODING_QUOTED_PRINTABLE; - } - - $altBodyEncoding = $this->Encoding; - $altBodyCharSet = $this->CharSet; - //Can we do a 7-bit downgrade? - if (static::ENCODING_8BIT === $altBodyEncoding && !$this->has8bitChars($this->AltBody)) { - $altBodyEncoding = static::ENCODING_7BIT; - //All ISO 8859, Windows codepage and UTF-8 charsets are ascii compatible up to 7-bit - $altBodyCharSet = static::CHARSET_ASCII; - } - //If lines are too long, and we're not already using an encoding that will shorten them, - //change to quoted-printable transfer encoding for the alt body part only - if (static::ENCODING_BASE64 !== $altBodyEncoding && static::hasLineLongerThanMax($this->AltBody)) { - $altBodyEncoding = static::ENCODING_QUOTED_PRINTABLE; - } - //Use this as a preamble in all multipart message types - $mimepre = 'This is a multi-part message in MIME format.' . static::$LE . static::$LE; - switch ($this->message_type) { - case 'inline': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= static::$LE; - $body .= $this->attachAll('inline', $this->boundary[1]); - break; - case 'attach': - $body .= $mimepre; - $body .= $this->getBoundary($this->boundary[1], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= static::$LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'inline_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); - $body .= $this->textLine(' boundary="' . $this->boundary[2] . '";'); - $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); - $body .= static::$LE; - $body .= $this->getBoundary($this->boundary[2], $bodyCharSet, '', $bodyEncoding); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= static::$LE; - $body .= $this->attachAll('inline', $this->boundary[2]); - $body .= static::$LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'alt': - $body .= $mimepre; - $body .= $this->getBoundary( - $this->boundary[1], - $altBodyCharSet, - static::CONTENT_TYPE_PLAINTEXT, - $altBodyEncoding - ); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= static::$LE; - $body .= $this->getBoundary( - $this->boundary[1], - $bodyCharSet, - static::CONTENT_TYPE_TEXT_HTML, - $bodyEncoding - ); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= static::$LE; - if (!empty($this->Ical)) { - $method = static::ICAL_METHOD_REQUEST; - foreach (static::$IcalMethods as $imethod) { - if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) { - $method = $imethod; - break; - } - } - $body .= $this->getBoundary( - $this->boundary[1], - '', - static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method, - '' - ); - $body .= $this->encodeString($this->Ical, $this->Encoding); - $body .= static::$LE; - } - $body .= $this->endBoundary($this->boundary[1]); - break; - case 'alt_inline': - $body .= $mimepre; - $body .= $this->getBoundary( - $this->boundary[1], - $altBodyCharSet, - static::CONTENT_TYPE_PLAINTEXT, - $altBodyEncoding - ); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= static::$LE; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); - $body .= $this->textLine(' boundary="' . $this->boundary[2] . '";'); - $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); - $body .= static::$LE; - $body .= $this->getBoundary( - $this->boundary[2], - $bodyCharSet, - static::CONTENT_TYPE_TEXT_HTML, - $bodyEncoding - ); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= static::$LE; - $body .= $this->attachAll('inline', $this->boundary[2]); - $body .= static::$LE; - $body .= $this->endBoundary($this->boundary[1]); - break; - case 'alt_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); - $body .= $this->textLine(' boundary="' . $this->boundary[2] . '"'); - $body .= static::$LE; - $body .= $this->getBoundary( - $this->boundary[2], - $altBodyCharSet, - static::CONTENT_TYPE_PLAINTEXT, - $altBodyEncoding - ); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= static::$LE; - $body .= $this->getBoundary( - $this->boundary[2], - $bodyCharSet, - static::CONTENT_TYPE_TEXT_HTML, - $bodyEncoding - ); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= static::$LE; - if (!empty($this->Ical)) { - $method = static::ICAL_METHOD_REQUEST; - foreach (static::$IcalMethods as $imethod) { - if (stripos($this->Ical, 'METHOD:' . $imethod) !== false) { - $method = $imethod; - break; - } - } - $body .= $this->getBoundary( - $this->boundary[2], - '', - static::CONTENT_TYPE_TEXT_CALENDAR . '; method=' . $method, - '' - ); - $body .= $this->encodeString($this->Ical, $this->Encoding); - } - $body .= $this->endBoundary($this->boundary[2]); - $body .= static::$LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - case 'alt_inline_attach': - $body .= $mimepre; - $body .= $this->textLine('--' . $this->boundary[1]); - $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_ALTERNATIVE . ';'); - $body .= $this->textLine(' boundary="' . $this->boundary[2] . '"'); - $body .= static::$LE; - $body .= $this->getBoundary( - $this->boundary[2], - $altBodyCharSet, - static::CONTENT_TYPE_PLAINTEXT, - $altBodyEncoding - ); - $body .= $this->encodeString($this->AltBody, $altBodyEncoding); - $body .= static::$LE; - $body .= $this->textLine('--' . $this->boundary[2]); - $body .= $this->headerLine('Content-Type', static::CONTENT_TYPE_MULTIPART_RELATED . ';'); - $body .= $this->textLine(' boundary="' . $this->boundary[3] . '";'); - $body .= $this->textLine(' type="' . static::CONTENT_TYPE_TEXT_HTML . '"'); - $body .= static::$LE; - $body .= $this->getBoundary( - $this->boundary[3], - $bodyCharSet, - static::CONTENT_TYPE_TEXT_HTML, - $bodyEncoding - ); - $body .= $this->encodeString($this->Body, $bodyEncoding); - $body .= static::$LE; - $body .= $this->attachAll('inline', $this->boundary[3]); - $body .= static::$LE; - $body .= $this->endBoundary($this->boundary[2]); - $body .= static::$LE; - $body .= $this->attachAll('attachment', $this->boundary[1]); - break; - default: - //Catch case 'plain' and case '', applies to simple `text/plain` and `text/html` body content types - //Reset the `Encoding` property in case we changed it for line length reasons - $this->Encoding = $bodyEncoding; - $body .= $this->encodeString($this->Body, $this->Encoding); - break; - } - - if ($this->isError()) { - $body = ''; - if ($this->exceptions) { - throw new Exception($this->lang('empty_message'), self::STOP_CRITICAL); - } - } elseif ($this->sign_key_file) { - try { - if (!defined('PKCS7_TEXT')) { - throw new Exception($this->lang('extension_missing') . 'openssl'); - } - - $file = tempnam(sys_get_temp_dir(), 'srcsign'); - $signed = tempnam(sys_get_temp_dir(), 'mailsign'); - file_put_contents($file, $body); - - //Workaround for PHP bug https://bugs.php.net/bug.php?id=69197 - if (empty($this->sign_extracerts_file)) { - $sign = @openssl_pkcs7_sign( - $file, - $signed, - 'file://' . realpath($this->sign_cert_file), - ['file://' . realpath($this->sign_key_file), $this->sign_key_pass], - [] - ); - } else { - $sign = @openssl_pkcs7_sign( - $file, - $signed, - 'file://' . realpath($this->sign_cert_file), - ['file://' . realpath($this->sign_key_file), $this->sign_key_pass], - [], - PKCS7_DETACHED, - $this->sign_extracerts_file - ); - } - - @unlink($file); - if ($sign) { - $body = file_get_contents($signed); - @unlink($signed); - //The message returned by openssl contains both headers and body, so need to split them up - $parts = explode("\n\n", $body, 2); - $this->MIMEHeader .= $parts[0] . static::$LE . static::$LE; - $body = $parts[1]; - } else { - @unlink($signed); - throw new Exception($this->lang('signing') . openssl_error_string()); - } - } catch (Exception $exc) { - $body = ''; - if ($this->exceptions) { - throw $exc; - } - } - } - - return $body; - } - - /** - * Return the start of a message boundary. - * - * @param string $boundary - * @param string $charSet - * @param string $contentType - * @param string $encoding - * - * @return string - */ - protected function getBoundary($boundary, $charSet, $contentType, $encoding) - { - $result = ''; - if ('' === $charSet) { - $charSet = $this->CharSet; - } - if ('' === $contentType) { - $contentType = $this->ContentType; - } - if ('' === $encoding) { - $encoding = $this->Encoding; - } - $result .= $this->textLine('--' . $boundary); - $result .= sprintf('Content-Type: %s; charset=%s', $contentType, $charSet); - $result .= static::$LE; - //RFC1341 part 5 says 7bit is assumed if not specified - if (static::ENCODING_7BIT !== $encoding) { - $result .= $this->headerLine('Content-Transfer-Encoding', $encoding); - } - $result .= static::$LE; - - return $result; - } - - /** - * Return the end of a message boundary. - * - * @param string $boundary - * - * @return string - */ - protected function endBoundary($boundary) - { - return static::$LE . '--' . $boundary . '--' . static::$LE; - } - - /** - * Set the message type. - * PHPMailer only supports some preset message types, not arbitrary MIME structures. - */ - protected function setMessageType() - { - $type = []; - if ($this->alternativeExists()) { - $type[] = 'alt'; - } - if ($this->inlineImageExists()) { - $type[] = 'inline'; - } - if ($this->attachmentExists()) { - $type[] = 'attach'; - } - $this->message_type = implode('_', $type); - if ('' === $this->message_type) { - //The 'plain' message_type refers to the message having a single body element, not that it is plain-text - $this->message_type = 'plain'; - } - } - - /** - * Format a header line. - * - * @param string $name - * @param string|int $value - * - * @return string - */ - public function headerLine($name, $value) - { - return $name . ': ' . $value . static::$LE; - } - - /** - * Return a formatted mail line. - * - * @param string $value - * - * @return string - */ - public function textLine($value) - { - return $value . static::$LE; - } - - /** - * Add an attachment from a path on the filesystem. - * Never use a user-supplied path to a file! - * Returns false if the file could not be found or read. - * Explicitly *does not* support passing URLs; PHPMailer is not an HTTP client. - * If you need to do that, fetch the resource yourself and pass it in via a local file or string. - * - * @param string $path Path to the attachment - * @param string $name Overrides the attachment name - * @param string $encoding File encoding (see $Encoding) - * @param string $type MIME type, e.g. `image/jpeg`; determined automatically from $path if not specified - * @param string $disposition Disposition to use - * - * @throws Exception - * - * @return bool - */ - public function addAttachment( - $path, - $name = '', - $encoding = self::ENCODING_BASE64, - $type = '', - $disposition = 'attachment' - ) { - try { - if (!static::fileIsAccessible($path)) { - throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); - } - - //If a MIME type is not specified, try to work it out from the file name - if ('' === $type) { - $type = static::filenameToType($path); - } - - $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME); - if ('' === $name) { - $name = $filename; - } - if (!$this->validateEncoding($encoding)) { - throw new Exception($this->lang('encoding') . $encoding); - } - - $this->attachment[] = [ - 0 => $path, - 1 => $filename, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => false, //isStringAttachment - 6 => $disposition, - 7 => $name, - ]; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - - return false; - } - - return true; - } - - /** - * Return the array of attachments. - * - * @return array - */ - public function getAttachments() - { - return $this->attachment; - } - - /** - * Attach all file, string, and binary attachments to the message. - * Returns an empty string on failure. - * - * @param string $disposition_type - * @param string $boundary - * - * @throws Exception - * - * @return string - */ - protected function attachAll($disposition_type, $boundary) - { - //Return text of body - $mime = []; - $cidUniq = []; - $incl = []; - - //Add all attachments - foreach ($this->attachment as $attachment) { - //Check if it is a valid disposition_filter - if ($attachment[6] === $disposition_type) { - //Check for string attachment - $string = ''; - $path = ''; - $bString = $attachment[5]; - if ($bString) { - $string = $attachment[0]; - } else { - $path = $attachment[0]; - } - - $inclhash = hash('sha256', serialize($attachment)); - if (in_array($inclhash, $incl, true)) { - continue; - } - $incl[] = $inclhash; - $name = $attachment[2]; - $encoding = $attachment[3]; - $type = $attachment[4]; - $disposition = $attachment[6]; - $cid = $attachment[7]; - if ('inline' === $disposition && array_key_exists($cid, $cidUniq)) { - continue; - } - $cidUniq[$cid] = true; - - $mime[] = sprintf('--%s%s', $boundary, static::$LE); - //Only include a filename property if we have one - if (!empty($name)) { - $mime[] = sprintf( - 'Content-Type: %s; name=%s%s', - $type, - static::quotedString($this->encodeHeader($this->secureHeader($name))), - static::$LE - ); - } else { - $mime[] = sprintf( - 'Content-Type: %s%s', - $type, - static::$LE - ); - } - //RFC1341 part 5 says 7bit is assumed if not specified - if (static::ENCODING_7BIT !== $encoding) { - $mime[] = sprintf('Content-Transfer-Encoding: %s%s', $encoding, static::$LE); - } - - //Only set Content-IDs on inline attachments - if ((string) $cid !== '' && $disposition === 'inline') { - $mime[] = 'Content-ID: <' . $this->encodeHeader($this->secureHeader($cid)) . '>' . static::$LE; - } - - //Allow for bypassing the Content-Disposition header - if (!empty($disposition)) { - $encoded_name = $this->encodeHeader($this->secureHeader($name)); - if (!empty($encoded_name)) { - $mime[] = sprintf( - 'Content-Disposition: %s; filename=%s%s', - $disposition, - static::quotedString($encoded_name), - static::$LE . static::$LE - ); - } else { - $mime[] = sprintf( - 'Content-Disposition: %s%s', - $disposition, - static::$LE . static::$LE - ); - } - } else { - $mime[] = static::$LE; - } - - //Encode as string attachment - if ($bString) { - $mime[] = $this->encodeString($string, $encoding); - } else { - $mime[] = $this->encodeFile($path, $encoding); - } - if ($this->isError()) { - return ''; - } - $mime[] = static::$LE; - } - } - - $mime[] = sprintf('--%s--%s', $boundary, static::$LE); - - return implode('', $mime); - } - - /** - * Encode a file attachment in requested format. - * Returns an empty string on failure. - * - * @param string $path The full path to the file - * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' - * - * @return string - */ - protected function encodeFile($path, $encoding = self::ENCODING_BASE64) - { - try { - if (!static::fileIsAccessible($path)) { - throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); - } - $file_buffer = file_get_contents($path); - if (false === $file_buffer) { - throw new Exception($this->lang('file_open') . $path, self::STOP_CONTINUE); - } - $file_buffer = $this->encodeString($file_buffer, $encoding); - - return $file_buffer; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - - return ''; - } - } - - /** - * Encode a string in requested format. - * Returns an empty string on failure. - * - * @param string $str The text to encode - * @param string $encoding The encoding to use; one of 'base64', '7bit', '8bit', 'binary', 'quoted-printable' - * - * @throws Exception - * - * @return string - */ - public function encodeString($str, $encoding = self::ENCODING_BASE64) - { - $encoded = ''; - switch (strtolower($encoding)) { - case static::ENCODING_BASE64: - $encoded = chunk_split( - base64_encode($str), - static::STD_LINE_LENGTH, - static::$LE - ); - break; - case static::ENCODING_7BIT: - case static::ENCODING_8BIT: - $encoded = static::normalizeBreaks($str); - //Make sure it ends with a line break - if (substr($encoded, -(strlen(static::$LE))) !== static::$LE) { - $encoded .= static::$LE; - } - break; - case static::ENCODING_BINARY: - $encoded = $str; - break; - case static::ENCODING_QUOTED_PRINTABLE: - $encoded = $this->encodeQP($str); - break; - default: - $this->setError($this->lang('encoding') . $encoding); - if ($this->exceptions) { - throw new Exception($this->lang('encoding') . $encoding); - } - break; - } - - return $encoded; - } - - /** - * Encode a header value (not including its label) optimally. - * Picks shortest of Q, B, or none. Result includes folding if needed. - * See RFC822 definitions for phrase, comment and text positions. - * - * @param string $str The header value to encode - * @param string $position What context the string will be used in - * - * @return string - */ - public function encodeHeader($str, $position = 'text') - { - $matchcount = 0; - switch (strtolower($position)) { - case 'phrase': - if (!preg_match('/[\200-\377]/', $str)) { - //Can't use addslashes as we don't know the value of magic_quotes_sybase - $encoded = addcslashes($str, "\0..\37\177\\\""); - if (($str === $encoded) && !preg_match('/[^A-Za-z0-9!#$%&\'*+\/=?^_`{|}~ -]/', $str)) { - return $encoded; - } - - return "\"$encoded\""; - } - $matchcount = preg_match_all('/[^\040\041\043-\133\135-\176]/', $str, $matches); - break; - /* @noinspection PhpMissingBreakStatementInspection */ - case 'comment': - $matchcount = preg_match_all('/[()"]/', $str, $matches); - //fallthrough - case 'text': - default: - $matchcount += preg_match_all('/[\000-\010\013\014\016-\037\177-\377]/', $str, $matches); - break; - } - - if ($this->has8bitChars($str)) { - $charset = $this->CharSet; - } else { - $charset = static::CHARSET_ASCII; - } - - //Q/B encoding adds 8 chars and the charset ("` =??[QB]??=`"). - $overhead = 8 + strlen($charset); - - if ('mail' === $this->Mailer) { - $maxlen = static::MAIL_MAX_LINE_LENGTH - $overhead; - } else { - $maxlen = static::MAX_LINE_LENGTH - $overhead; - } - - //Select the encoding that produces the shortest output and/or prevents corruption. - if ($matchcount > strlen($str) / 3) { - //More than 1/3 of the content needs encoding, use B-encode. - $encoding = 'B'; - } elseif ($matchcount > 0) { - //Less than 1/3 of the content needs encoding, use Q-encode. - $encoding = 'Q'; - } elseif (strlen($str) > $maxlen) { - //No encoding needed, but value exceeds max line length, use Q-encode to prevent corruption. - $encoding = 'Q'; - } else { - //No reformatting needed - $encoding = false; - } - - switch ($encoding) { - case 'B': - if ($this->hasMultiBytes($str)) { - //Use a custom function which correctly encodes and wraps long - //multibyte strings without breaking lines within a character - $encoded = $this->base64EncodeWrapMB($str, "\n"); - } else { - $encoded = base64_encode($str); - $maxlen -= $maxlen % 4; - $encoded = trim(chunk_split($encoded, $maxlen, "\n")); - } - $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); - break; - case 'Q': - $encoded = $this->encodeQ($str, $position); - $encoded = $this->wrapText($encoded, $maxlen, true); - $encoded = str_replace('=' . static::$LE, "\n", trim($encoded)); - $encoded = preg_replace('/^(.*)$/m', ' =?' . $charset . "?$encoding?\\1?=", $encoded); - break; - default: - return $str; - } - - return trim(static::normalizeBreaks($encoded)); - } - - /** - * Check if a string contains multi-byte characters. - * - * @param string $str multi-byte text to wrap encode - * - * @return bool - */ - public function hasMultiBytes($str) - { - if (function_exists('mb_strlen')) { - return strlen($str) > mb_strlen($str, $this->CharSet); - } - - //Assume no multibytes (we can't handle without mbstring functions anyway) - return false; - } - - /** - * Does a string contain any 8-bit chars (in any charset)? - * - * @param string $text - * - * @return bool - */ - public function has8bitChars($text) - { - return (bool) preg_match('/[\x80-\xFF]/', $text); - } - - /** - * Encode and wrap long multibyte strings for mail headers - * without breaking lines within a character. - * Adapted from a function by paravoid. - * - * @see http://www.php.net/manual/en/function.mb-encode-mimeheader.php#60283 - * - * @param string $str multi-byte text to wrap encode - * @param string $linebreak string to use as linefeed/end-of-line - * - * @return string - */ - public function base64EncodeWrapMB($str, $linebreak = null) - { - $start = '=?' . $this->CharSet . '?B?'; - $end = '?='; - $encoded = ''; - if (null === $linebreak) { - $linebreak = static::$LE; - } - - $mb_length = mb_strlen($str, $this->CharSet); - //Each line must have length <= 75, including $start and $end - $length = 75 - strlen($start) - strlen($end); - //Average multi-byte ratio - $ratio = $mb_length / strlen($str); - //Base64 has a 4:3 ratio - $avgLength = floor($length * $ratio * .75); - - $offset = 0; - for ($i = 0; $i < $mb_length; $i += $offset) { - $lookBack = 0; - do { - $offset = $avgLength - $lookBack; - $chunk = mb_substr($str, $i, $offset, $this->CharSet); - $chunk = base64_encode($chunk); - ++$lookBack; - } while (strlen($chunk) > $length); - $encoded .= $chunk . $linebreak; - } - - //Chomp the last linefeed - return substr($encoded, 0, -strlen($linebreak)); - } - - /** - * Encode a string in quoted-printable format. - * According to RFC2045 section 6.7. - * - * @param string $string The text to encode - * - * @return string - */ - public function encodeQP($string) - { - return static::normalizeBreaks(quoted_printable_encode($string)); - } - - /** - * Encode a string using Q encoding. - * - * @see http://tools.ietf.org/html/rfc2047#section-4.2 - * - * @param string $str the text to encode - * @param string $position Where the text is going to be used, see the RFC for what that means - * - * @return string - */ - public function encodeQ($str, $position = 'text') - { - //There should not be any EOL in the string - $pattern = ''; - $encoded = str_replace(["\r", "\n"], '', $str); - switch (strtolower($position)) { - case 'phrase': - //RFC 2047 section 5.3 - $pattern = '^A-Za-z0-9!*+\/ -'; - break; - /* - * RFC 2047 section 5.2. - * Build $pattern without including delimiters and [] - */ - /* @noinspection PhpMissingBreakStatementInspection */ - case 'comment': - $pattern = '\(\)"'; - /* Intentional fall through */ - case 'text': - default: - //RFC 2047 section 5.1 - //Replace every high ascii, control, =, ? and _ characters - $pattern = '\000-\011\013\014\016-\037\075\077\137\177-\377' . $pattern; - break; - } - $matches = []; - if (preg_match_all("/[{$pattern}]/", $encoded, $matches)) { - //If the string contains an '=', make sure it's the first thing we replace - //so as to avoid double-encoding - $eqkey = array_search('=', $matches[0], true); - if (false !== $eqkey) { - unset($matches[0][$eqkey]); - array_unshift($matches[0], '='); - } - foreach (array_unique($matches[0]) as $char) { - $encoded = str_replace($char, '=' . sprintf('%02X', ord($char)), $encoded); - } - } - //Replace spaces with _ (more readable than =20) - //RFC 2047 section 4.2(2) - return str_replace(' ', '_', $encoded); - } - - /** - * Add a string or binary attachment (non-filesystem). - * This method can be used to attach ascii or binary data, - * such as a BLOB record from a database. - * - * @param string $string String attachment data - * @param string $filename Name of the attachment - * @param string $encoding File encoding (see $Encoding) - * @param string $type File extension (MIME) type - * @param string $disposition Disposition to use - * - * @throws Exception - * - * @return bool True on successfully adding an attachment - */ - public function addStringAttachment( - $string, - $filename, - $encoding = self::ENCODING_BASE64, - $type = '', - $disposition = 'attachment' - ) { - try { - //If a MIME type is not specified, try to work it out from the file name - if ('' === $type) { - $type = static::filenameToType($filename); - } - - if (!$this->validateEncoding($encoding)) { - throw new Exception($this->lang('encoding') . $encoding); - } - - //Append to $attachment array - $this->attachment[] = [ - 0 => $string, - 1 => $filename, - 2 => static::mb_pathinfo($filename, PATHINFO_BASENAME), - 3 => $encoding, - 4 => $type, - 5 => true, //isStringAttachment - 6 => $disposition, - 7 => 0, - ]; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - - return false; - } - - return true; - } - - /** - * Add an embedded (inline) attachment from a file. - * This can include images, sounds, and just about any other document type. - * These differ from 'regular' attachments in that they are intended to be - * displayed inline with the message, not just attached for download. - * This is used in HTML messages that embed the images - * the HTML refers to using the $cid value. - * Never use a user-supplied path to a file! - * - * @param string $path Path to the attachment - * @param string $cid Content ID of the attachment; Use this to reference - * the content when using an embedded image in HTML - * @param string $name Overrides the attachment name - * @param string $encoding File encoding (see $Encoding) - * @param string $type File MIME type - * @param string $disposition Disposition to use - * - * @throws Exception - * - * @return bool True on successfully adding an attachment - */ - public function addEmbeddedImage( - $path, - $cid, - $name = '', - $encoding = self::ENCODING_BASE64, - $type = '', - $disposition = 'inline' - ) { - try { - if (!static::fileIsAccessible($path)) { - throw new Exception($this->lang('file_access') . $path, self::STOP_CONTINUE); - } - - //If a MIME type is not specified, try to work it out from the file name - if ('' === $type) { - $type = static::filenameToType($path); - } - - if (!$this->validateEncoding($encoding)) { - throw new Exception($this->lang('encoding') . $encoding); - } - - $filename = (string) static::mb_pathinfo($path, PATHINFO_BASENAME); - if ('' === $name) { - $name = $filename; - } - - //Append to $attachment array - $this->attachment[] = [ - 0 => $path, - 1 => $filename, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => false, //isStringAttachment - 6 => $disposition, - 7 => $cid, - ]; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - - return false; - } - - return true; - } - - /** - * Add an embedded stringified attachment. - * This can include images, sounds, and just about any other document type. - * If your filename doesn't contain an extension, be sure to set the $type to an appropriate MIME type. - * - * @param string $string The attachment binary data - * @param string $cid Content ID of the attachment; Use this to reference - * the content when using an embedded image in HTML - * @param string $name A filename for the attachment. If this contains an extension, - * PHPMailer will attempt to set a MIME type for the attachment. - * For example 'file.jpg' would get an 'image/jpeg' MIME type. - * @param string $encoding File encoding (see $Encoding), defaults to 'base64' - * @param string $type MIME type - will be used in preference to any automatically derived type - * @param string $disposition Disposition to use - * - * @throws Exception - * - * @return bool True on successfully adding an attachment - */ - public function addStringEmbeddedImage( - $string, - $cid, - $name = '', - $encoding = self::ENCODING_BASE64, - $type = '', - $disposition = 'inline' - ) { - try { - //If a MIME type is not specified, try to work it out from the name - if ('' === $type && !empty($name)) { - $type = static::filenameToType($name); - } - - if (!$this->validateEncoding($encoding)) { - throw new Exception($this->lang('encoding') . $encoding); - } - - //Append to $attachment array - $this->attachment[] = [ - 0 => $string, - 1 => $name, - 2 => $name, - 3 => $encoding, - 4 => $type, - 5 => true, //isStringAttachment - 6 => $disposition, - 7 => $cid, - ]; - } catch (Exception $exc) { - $this->setError($exc->getMessage()); - $this->edebug($exc->getMessage()); - if ($this->exceptions) { - throw $exc; - } - - return false; - } - - return true; - } - - /** - * Validate encodings. - * - * @param string $encoding - * - * @return bool - */ - protected function validateEncoding($encoding) - { - return in_array( - $encoding, - [ - self::ENCODING_7BIT, - self::ENCODING_QUOTED_PRINTABLE, - self::ENCODING_BASE64, - self::ENCODING_8BIT, - self::ENCODING_BINARY, - ], - true - ); - } - - /** - * Check if an embedded attachment is present with this cid. - * - * @param string $cid - * - * @return bool - */ - protected function cidExists($cid) - { - foreach ($this->attachment as $attachment) { - if ('inline' === $attachment[6] && $cid === $attachment[7]) { - return true; - } - } - - return false; - } - - /** - * Check if an inline attachment is present. - * - * @return bool - */ - public function inlineImageExists() - { - foreach ($this->attachment as $attachment) { - if ('inline' === $attachment[6]) { - return true; - } - } - - return false; - } - - /** - * Check if an attachment (non-inline) is present. - * - * @return bool - */ - public function attachmentExists() - { - foreach ($this->attachment as $attachment) { - if ('attachment' === $attachment[6]) { - return true; - } - } - - return false; - } - - /** - * Check if this message has an alternative body set. - * - * @return bool - */ - public function alternativeExists() - { - return !empty($this->AltBody); - } - - /** - * Clear queued addresses of given kind. - * - * @param string $kind 'to', 'cc', or 'bcc' - */ - public function clearQueuedAddresses($kind) - { - $this->RecipientsQueue = array_filter( - $this->RecipientsQueue, - static function ($params) use ($kind) { - return $params[0] !== $kind; - } - ); - } - - /** - * Clear all To recipients. - */ - public function clearAddresses() - { - foreach ($this->to as $to) { - unset($this->all_recipients[strtolower($to[0])]); - } - $this->to = []; - $this->clearQueuedAddresses('to'); - } - - /** - * Clear all CC recipients. - */ - public function clearCCs() - { - foreach ($this->cc as $cc) { - unset($this->all_recipients[strtolower($cc[0])]); - } - $this->cc = []; - $this->clearQueuedAddresses('cc'); - } - - /** - * Clear all BCC recipients. - */ - public function clearBCCs() - { - foreach ($this->bcc as $bcc) { - unset($this->all_recipients[strtolower($bcc[0])]); - } - $this->bcc = []; - $this->clearQueuedAddresses('bcc'); - } - - /** - * Clear all ReplyTo recipients. - */ - public function clearReplyTos() - { - $this->ReplyTo = []; - $this->ReplyToQueue = []; - } - - /** - * Clear all recipient types. - */ - public function clearAllRecipients() - { - $this->to = []; - $this->cc = []; - $this->bcc = []; - $this->all_recipients = []; - $this->RecipientsQueue = []; - } - - /** - * Clear all filesystem, string, and binary attachments. - */ - public function clearAttachments() - { - $this->attachment = []; - } - - /** - * Clear all custom headers. - */ - public function clearCustomHeaders() - { - $this->CustomHeader = []; - } - - /** - * Add an error message to the error container. - * - * @param string $msg - */ - protected function setError($msg) - { - ++$this->error_count; - if ('smtp' === $this->Mailer && null !== $this->smtp) { - $lasterror = $this->smtp->getError(); - if (!empty($lasterror['error'])) { - $msg .= $this->lang('smtp_error') . $lasterror['error']; - if (!empty($lasterror['detail'])) { - $msg .= ' Detail: ' . $lasterror['detail']; - } - if (!empty($lasterror['smtp_code'])) { - $msg .= ' SMTP code: ' . $lasterror['smtp_code']; - } - if (!empty($lasterror['smtp_code_ex'])) { - $msg .= ' Additional SMTP info: ' . $lasterror['smtp_code_ex']; - } - } - } - $this->ErrorInfo = $msg; - } - - /** - * Return an RFC 822 formatted date. - * - * @return string - */ - public static function rfcDate() - { - //Set the time zone to whatever the default is to avoid 500 errors - //Will default to UTC if it's not set properly in php.ini - date_default_timezone_set(@date_default_timezone_get()); - - return date('D, j M Y H:i:s O'); - } - - /** - * Get the server hostname. - * Returns 'localhost.localdomain' if unknown. - * - * @return string - */ - protected function serverHostname() - { - $result = ''; - if (!empty($this->Hostname)) { - $result = $this->Hostname; - } elseif (isset($_SERVER) && array_key_exists('SERVER_NAME', $_SERVER)) { - $result = $_SERVER['SERVER_NAME']; - } elseif (function_exists('gethostname') && gethostname() !== false) { - $result = gethostname(); - } elseif (php_uname('n') !== false) { - $result = php_uname('n'); - } - if (!static::isValidHost($result)) { - return 'localhost.localdomain'; - } - - return $result; - } - - /** - * Validate whether a string contains a valid value to use as a hostname or IP address. - * IPv6 addresses must include [], e.g. `[::1]`, not just `::1`. - * - * @param string $host The host name or IP address to check - * - * @return bool - */ - public static function isValidHost($host) - { - //Simple syntax limits - if ( - empty($host) - || !is_string($host) - || strlen($host) > 256 - || !preg_match('/^([a-zA-Z\d.-]*|\[[a-fA-F\d:]+])$/', $host) - ) { - return false; - } - //Looks like a bracketed IPv6 address - if (strlen($host) > 2 && substr($host, 0, 1) === '[' && substr($host, -1, 1) === ']') { - return filter_var(substr($host, 1, -1), FILTER_VALIDATE_IP, FILTER_FLAG_IPV6) !== false; - } - //If removing all the dots results in a numeric string, it must be an IPv4 address. - //Need to check this first because otherwise things like `999.0.0.0` are considered valid host names - if (is_numeric(str_replace('.', '', $host))) { - //Is it a valid IPv4 address? - return filter_var($host, FILTER_VALIDATE_IP, FILTER_FLAG_IPV4) !== false; - } - if (filter_var('http://' . $host, FILTER_VALIDATE_URL) !== false) { - //Is it a syntactically valid hostname? - return true; - } - - return false; - } - - /** - * Get an error message in the current language. - * - * @param string $key - * - * @return string - */ - protected function lang($key) - { - if (count($this->language) < 1) { - $this->setLanguage(); //Set the default language - } - - if (array_key_exists($key, $this->language)) { - if ('smtp_connect_failed' === $key) { - //Include a link to troubleshooting docs on SMTP connection failure. - //This is by far the biggest cause of support questions - //but it's usually not PHPMailer's fault. - return $this->language[$key] . ' https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting'; - } - - return $this->language[$key]; - } - - //Return the key as a fallback - return $key; - } - - /** - * Check if an error occurred. - * - * @return bool True if an error did occur - */ - public function isError() - { - return $this->error_count > 0; - } - - /** - * Add a custom header. - * $name value can be overloaded to contain - * both header name and value (name:value). - * - * @param string $name Custom header name - * @param string|null $value Header value - * - * @throws Exception - */ - public function addCustomHeader($name, $value = null) - { - if (null === $value && strpos($name, ':') !== false) { - //Value passed in as name:value - list($name, $value) = explode(':', $name, 2); - } - $name = trim($name); - $value = trim($value); - //Ensure name is not empty, and that neither name nor value contain line breaks - if (empty($name) || strpbrk($name . $value, "\r\n") !== false) { - if ($this->exceptions) { - throw new Exception('Invalid header name or value'); - } - - return false; - } - $this->CustomHeader[] = [$name, $value]; - - return true; - } - - /** - * Returns all custom headers. - * - * @return array - */ - public function getCustomHeaders() - { - return $this->CustomHeader; - } - - /** - * Create a message body from an HTML string. - * Automatically inlines images and creates a plain-text version by converting the HTML, - * overwriting any existing values in Body and AltBody. - * Do not source $message content from user input! - * $basedir is prepended when handling relative URLs, e.g. and must not be empty - * will look for an image file in $basedir/images/a.png and convert it to inline. - * If you don't provide a $basedir, relative paths will be left untouched (and thus probably break in email) - * Converts data-uri images into embedded attachments. - * If you don't want to apply these transformations to your HTML, just set Body and AltBody directly. - * - * @param string $message HTML message string - * @param string $basedir Absolute path to a base directory to prepend to relative paths to images - * @param bool|callable $advanced Whether to use the internal HTML to text converter - * or your own custom converter - * @return string The transformed message body - * - * @throws Exception - * - * @see PHPMailer::html2text() - */ - public function msgHTML($message, $basedir = '', $advanced = false) - { - preg_match_all('/(? 1 && '/' !== substr($basedir, -1)) { - //Ensure $basedir has a trailing / - $basedir .= '/'; - } - foreach ($images[2] as $imgindex => $url) { - //Convert data URIs into embedded images - //e.g. "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" - $match = []; - if (preg_match('#^data:(image/(?:jpe?g|gif|png));?(base64)?,(.+)#', $url, $match)) { - if (count($match) === 4 && static::ENCODING_BASE64 === $match[2]) { - $data = base64_decode($match[3]); - } elseif ('' === $match[2]) { - $data = rawurldecode($match[3]); - } else { - //Not recognised so leave it alone - continue; - } - //Hash the decoded data, not the URL, so that the same data-URI image used in multiple places - //will only be embedded once, even if it used a different encoding - $cid = substr(hash('sha256', $data), 0, 32) . '@phpmailer.0'; //RFC2392 S 2 - - if (!$this->cidExists($cid)) { - $this->addStringEmbeddedImage( - $data, - $cid, - 'embed' . $imgindex, - static::ENCODING_BASE64, - $match[1] - ); - } - $message = str_replace( - $images[0][$imgindex], - $images[1][$imgindex] . '="cid:' . $cid . '"', - $message - ); - continue; - } - if ( - //Only process relative URLs if a basedir is provided (i.e. no absolute local paths) - !empty($basedir) - //Ignore URLs containing parent dir traversal (..) - && (strpos($url, '..') === false) - //Do not change urls that are already inline images - && 0 !== strpos($url, 'cid:') - //Do not change absolute URLs, including anonymous protocol - && !preg_match('#^[a-z][a-z0-9+.-]*:?//#i', $url) - ) { - $filename = static::mb_pathinfo($url, PATHINFO_BASENAME); - $directory = dirname($url); - if ('.' === $directory) { - $directory = ''; - } - //RFC2392 S 2 - $cid = substr(hash('sha256', $url), 0, 32) . '@phpmailer.0'; - if (strlen($basedir) > 1 && '/' !== substr($basedir, -1)) { - $basedir .= '/'; - } - if (strlen($directory) > 1 && '/' !== substr($directory, -1)) { - $directory .= '/'; - } - if ( - $this->addEmbeddedImage( - $basedir . $directory . $filename, - $cid, - $filename, - static::ENCODING_BASE64, - static::_mime_types((string) static::mb_pathinfo($filename, PATHINFO_EXTENSION)) - ) - ) { - $message = preg_replace( - '/' . $images[1][$imgindex] . '=["\']' . preg_quote($url, '/') . '["\']/Ui', - $images[1][$imgindex] . '="cid:' . $cid . '"', - $message - ); - } - } - } - } - $this->isHTML(); - //Convert all message body line breaks to LE, makes quoted-printable encoding work much better - $this->Body = static::normalizeBreaks($message); - $this->AltBody = static::normalizeBreaks($this->html2text($message, $advanced)); - if (!$this->alternativeExists()) { - $this->AltBody = 'This is an HTML-only message. To view it, activate HTML in your email application.' - . static::$LE; - } - - return $this->Body; - } - - /** - * Convert an HTML string into plain text. - * This is used by msgHTML(). - * Note - older versions of this function used a bundled advanced converter - * which was removed for license reasons in #232. - * Example usage: - * - * ```php - * //Use default conversion - * $plain = $mail->html2text($html); - * //Use your own custom converter - * $plain = $mail->html2text($html, function($html) { - * $converter = new MyHtml2text($html); - * return $converter->get_text(); - * }); - * ``` - * - * @param string $html The HTML text to convert - * @param bool|callable $advanced Any boolean value to use the internal converter, - * or provide your own callable for custom conversion - * - * @return string - */ - public function html2text($html, $advanced = false) - { - if (is_callable($advanced)) { - return call_user_func($advanced, $html); - } - - return html_entity_decode( - trim(strip_tags(preg_replace('/<(head|title|style|script)[^>]*>.*?<\/\\1>/si', '', $html))), - ENT_QUOTES, - $this->CharSet - ); - } - - /** - * Get the MIME type for a file extension. - * - * @param string $ext File extension - * - * @return string MIME type of file - */ - public static function _mime_types($ext = '') - { - $mimes = [ - 'xl' => 'application/excel', - 'js' => 'application/javascript', - 'hqx' => 'application/mac-binhex40', - 'cpt' => 'application/mac-compactpro', - 'bin' => 'application/macbinary', - 'doc' => 'application/msword', - 'word' => 'application/msword', - 'xlsx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet', - 'xltx' => 'application/vnd.openxmlformats-officedocument.spreadsheetml.template', - 'potx' => 'application/vnd.openxmlformats-officedocument.presentationml.template', - 'ppsx' => 'application/vnd.openxmlformats-officedocument.presentationml.slideshow', - 'pptx' => 'application/vnd.openxmlformats-officedocument.presentationml.presentation', - 'sldx' => 'application/vnd.openxmlformats-officedocument.presentationml.slide', - 'docx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.document', - 'dotx' => 'application/vnd.openxmlformats-officedocument.wordprocessingml.template', - 'xlam' => 'application/vnd.ms-excel.addin.macroEnabled.12', - 'xlsb' => 'application/vnd.ms-excel.sheet.binary.macroEnabled.12', - 'class' => 'application/octet-stream', - 'dll' => 'application/octet-stream', - 'dms' => 'application/octet-stream', - 'exe' => 'application/octet-stream', - 'lha' => 'application/octet-stream', - 'lzh' => 'application/octet-stream', - 'psd' => 'application/octet-stream', - 'sea' => 'application/octet-stream', - 'so' => 'application/octet-stream', - 'oda' => 'application/oda', - 'pdf' => 'application/pdf', - 'ai' => 'application/postscript', - 'eps' => 'application/postscript', - 'ps' => 'application/postscript', - 'smi' => 'application/smil', - 'smil' => 'application/smil', - 'mif' => 'application/vnd.mif', - 'xls' => 'application/vnd.ms-excel', - 'ppt' => 'application/vnd.ms-powerpoint', - 'wbxml' => 'application/vnd.wap.wbxml', - 'wmlc' => 'application/vnd.wap.wmlc', - 'dcr' => 'application/x-director', - 'dir' => 'application/x-director', - 'dxr' => 'application/x-director', - 'dvi' => 'application/x-dvi', - 'gtar' => 'application/x-gtar', - 'php3' => 'application/x-httpd-php', - 'php4' => 'application/x-httpd-php', - 'php' => 'application/x-httpd-php', - 'phtml' => 'application/x-httpd-php', - 'phps' => 'application/x-httpd-php-source', - 'swf' => 'application/x-shockwave-flash', - 'sit' => 'application/x-stuffit', - 'tar' => 'application/x-tar', - 'tgz' => 'application/x-tar', - 'xht' => 'application/xhtml+xml', - 'xhtml' => 'application/xhtml+xml', - 'zip' => 'application/zip', - 'mid' => 'audio/midi', - 'midi' => 'audio/midi', - 'mp2' => 'audio/mpeg', - 'mp3' => 'audio/mpeg', - 'm4a' => 'audio/mp4', - 'mpga' => 'audio/mpeg', - 'aif' => 'audio/x-aiff', - 'aifc' => 'audio/x-aiff', - 'aiff' => 'audio/x-aiff', - 'ram' => 'audio/x-pn-realaudio', - 'rm' => 'audio/x-pn-realaudio', - 'rpm' => 'audio/x-pn-realaudio-plugin', - 'ra' => 'audio/x-realaudio', - 'wav' => 'audio/x-wav', - 'mka' => 'audio/x-matroska', - 'bmp' => 'image/bmp', - 'gif' => 'image/gif', - 'jpeg' => 'image/jpeg', - 'jpe' => 'image/jpeg', - 'jpg' => 'image/jpeg', - 'png' => 'image/png', - 'tiff' => 'image/tiff', - 'tif' => 'image/tiff', - 'webp' => 'image/webp', - 'avif' => 'image/avif', - 'heif' => 'image/heif', - 'heifs' => 'image/heif-sequence', - 'heic' => 'image/heic', - 'heics' => 'image/heic-sequence', - 'eml' => 'message/rfc822', - 'css' => 'text/css', - 'html' => 'text/html', - 'htm' => 'text/html', - 'shtml' => 'text/html', - 'log' => 'text/plain', - 'text' => 'text/plain', - 'txt' => 'text/plain', - 'rtx' => 'text/richtext', - 'rtf' => 'text/rtf', - 'vcf' => 'text/vcard', - 'vcard' => 'text/vcard', - 'ics' => 'text/calendar', - 'xml' => 'text/xml', - 'xsl' => 'text/xml', - 'wmv' => 'video/x-ms-wmv', - 'mpeg' => 'video/mpeg', - 'mpe' => 'video/mpeg', - 'mpg' => 'video/mpeg', - 'mp4' => 'video/mp4', - 'm4v' => 'video/mp4', - 'mov' => 'video/quicktime', - 'qt' => 'video/quicktime', - 'rv' => 'video/vnd.rn-realvideo', - 'avi' => 'video/x-msvideo', - 'movie' => 'video/x-sgi-movie', - 'webm' => 'video/webm', - 'mkv' => 'video/x-matroska', - ]; - $ext = strtolower($ext); - if (array_key_exists($ext, $mimes)) { - return $mimes[$ext]; - } - - return 'application/octet-stream'; - } - - /** - * Map a file name to a MIME type. - * Defaults to 'application/octet-stream', i.e.. arbitrary binary data. - * - * @param string $filename A file name or full path, does not need to exist as a file - * - * @return string - */ - public static function filenameToType($filename) - { - //In case the path is a URL, strip any query string before getting extension - $qpos = strpos($filename, '?'); - if (false !== $qpos) { - $filename = substr($filename, 0, $qpos); - } - $ext = static::mb_pathinfo($filename, PATHINFO_EXTENSION); - - return static::_mime_types($ext); - } - - /** - * Multi-byte-safe pathinfo replacement. - * Drop-in replacement for pathinfo(), but multibyte- and cross-platform-safe. - * - * @see http://www.php.net/manual/en/function.pathinfo.php#107461 - * - * @param string $path A filename or path, does not need to exist as a file - * @param int|string $options Either a PATHINFO_* constant, - * or a string name to return only the specified piece - * - * @return string|array - */ - public static function mb_pathinfo($path, $options = null) - { - $ret = ['dirname' => '', 'basename' => '', 'extension' => '', 'filename' => '']; - $pathinfo = []; - if (preg_match('#^(.*?)[\\\\/]*(([^/\\\\]*?)(\.([^.\\\\/]+?)|))[\\\\/.]*$#m', $path, $pathinfo)) { - if (array_key_exists(1, $pathinfo)) { - $ret['dirname'] = $pathinfo[1]; - } - if (array_key_exists(2, $pathinfo)) { - $ret['basename'] = $pathinfo[2]; - } - if (array_key_exists(5, $pathinfo)) { - $ret['extension'] = $pathinfo[5]; - } - if (array_key_exists(3, $pathinfo)) { - $ret['filename'] = $pathinfo[3]; - } - } - switch ($options) { - case PATHINFO_DIRNAME: - case 'dirname': - return $ret['dirname']; - case PATHINFO_BASENAME: - case 'basename': - return $ret['basename']; - case PATHINFO_EXTENSION: - case 'extension': - return $ret['extension']; - case PATHINFO_FILENAME: - case 'filename': - return $ret['filename']; - default: - return $ret; - } - } - - /** - * Set or reset instance properties. - * You should avoid this function - it's more verbose, less efficient, more error-prone and - * harder to debug than setting properties directly. - * Usage Example: - * `$mail->set('SMTPSecure', static::ENCRYPTION_STARTTLS);` - * is the same as: - * `$mail->SMTPSecure = static::ENCRYPTION_STARTTLS;`. - * - * @param string $name The property name to set - * @param mixed $value The value to set the property to - * - * @return bool - */ - public function set($name, $value = '') - { - if (property_exists($this, $name)) { - $this->$name = $value; - - return true; - } - $this->setError($this->lang('variable_set') . $name); - - return false; - } - - /** - * Strip newlines to prevent header injection. - * - * @param string $str - * - * @return string - */ - public function secureHeader($str) - { - return trim(str_replace(["\r", "\n"], '', $str)); - } - - /** - * Normalize line breaks in a string. - * Converts UNIX LF, Mac CR and Windows CRLF line breaks into a single line break format. - * Defaults to CRLF (for message bodies) and preserves consecutive breaks. - * - * @param string $text - * @param string $breaktype What kind of line break to use; defaults to static::$LE - * - * @return string - */ - public static function normalizeBreaks($text, $breaktype = null) - { - if (null === $breaktype) { - $breaktype = static::$LE; - } - //Normalise to \n - $text = str_replace([self::CRLF, "\r"], "\n", $text); - //Now convert LE as needed - if ("\n" !== $breaktype) { - $text = str_replace("\n", $breaktype, $text); - } - - return $text; - } - - /** - * Remove trailing breaks from a string. - * - * @param string $text - * - * @return string The text to remove breaks from - */ - public static function stripTrailingWSP($text) - { - return rtrim($text, " \r\n\t"); - } - - /** - * Return the current line break format string. - * - * @return string - */ - public static function getLE() - { - return static::$LE; - } - - /** - * Set the line break format string, e.g. "\r\n". - * - * @param string $le - */ - protected static function setLE($le) - { - static::$LE = $le; - } - - /** - * Set the public and private key files and password for S/MIME signing. - * - * @param string $cert_filename - * @param string $key_filename - * @param string $key_pass Password for private key - * @param string $extracerts_filename Optional path to chain certificate - */ - public function sign($cert_filename, $key_filename, $key_pass, $extracerts_filename = '') - { - $this->sign_cert_file = $cert_filename; - $this->sign_key_file = $key_filename; - $this->sign_key_pass = $key_pass; - $this->sign_extracerts_file = $extracerts_filename; - } - - /** - * Quoted-Printable-encode a DKIM header. - * - * @param string $txt - * - * @return string - */ - public function DKIM_QP($txt) - { - $line = ''; - $len = strlen($txt); - for ($i = 0; $i < $len; ++$i) { - $ord = ord($txt[$i]); - if (((0x21 <= $ord) && ($ord <= 0x3A)) || $ord === 0x3C || ((0x3E <= $ord) && ($ord <= 0x7E))) { - $line .= $txt[$i]; - } else { - $line .= '=' . sprintf('%02X', $ord); - } - } - - return $line; - } - - /** - * Generate a DKIM signature. - * - * @param string $signHeader - * - * @throws Exception - * - * @return string The DKIM signature value - */ - public function DKIM_Sign($signHeader) - { - if (!defined('PKCS7_TEXT')) { - if ($this->exceptions) { - throw new Exception($this->lang('extension_missing') . 'openssl'); - } - - return ''; - } - $privKeyStr = !empty($this->DKIM_private_string) ? - $this->DKIM_private_string : - file_get_contents($this->DKIM_private); - if ('' !== $this->DKIM_passphrase) { - $privKey = openssl_pkey_get_private($privKeyStr, $this->DKIM_passphrase); - } else { - $privKey = openssl_pkey_get_private($privKeyStr); - } - if (openssl_sign($signHeader, $signature, $privKey, 'sha256WithRSAEncryption')) { - if (\PHP_MAJOR_VERSION < 8) { - openssl_pkey_free($privKey); - } - - return base64_encode($signature); - } - if (\PHP_MAJOR_VERSION < 8) { - openssl_pkey_free($privKey); - } - - return ''; - } - - /** - * Generate a DKIM canonicalization header. - * Uses the 'relaxed' algorithm from RFC6376 section 3.4.2. - * Canonicalized headers should *always* use CRLF, regardless of mailer setting. - * - * @see https://tools.ietf.org/html/rfc6376#section-3.4.2 - * - * @param string $signHeader Header - * - * @return string - */ - public function DKIM_HeaderC($signHeader) - { - //Normalize breaks to CRLF (regardless of the mailer) - $signHeader = static::normalizeBreaks($signHeader, self::CRLF); - //Unfold header lines - //Note PCRE \s is too broad a definition of whitespace; RFC5322 defines it as `[ \t]` - //@see https://tools.ietf.org/html/rfc5322#section-2.2 - //That means this may break if you do something daft like put vertical tabs in your headers. - $signHeader = preg_replace('/\r\n[ \t]+/', ' ', $signHeader); - //Break headers out into an array - $lines = explode(self::CRLF, $signHeader); - foreach ($lines as $key => $line) { - //If the header is missing a :, skip it as it's invalid - //This is likely to happen because the explode() above will also split - //on the trailing LE, leaving an empty line - if (strpos($line, ':') === false) { - continue; - } - list($heading, $value) = explode(':', $line, 2); - //Lower-case header name - $heading = strtolower($heading); - //Collapse white space within the value, also convert WSP to space - $value = preg_replace('/[ \t]+/', ' ', $value); - //RFC6376 is slightly unclear here - it says to delete space at the *end* of each value - //But then says to delete space before and after the colon. - //Net result is the same as trimming both ends of the value. - //By elimination, the same applies to the field name - $lines[$key] = trim($heading, " \t") . ':' . trim($value, " \t"); - } - - return implode(self::CRLF, $lines); - } - - /** - * Generate a DKIM canonicalization body. - * Uses the 'simple' algorithm from RFC6376 section 3.4.3. - * Canonicalized bodies should *always* use CRLF, regardless of mailer setting. - * - * @see https://tools.ietf.org/html/rfc6376#section-3.4.3 - * - * @param string $body Message Body - * - * @return string - */ - public function DKIM_BodyC($body) - { - if (empty($body)) { - return self::CRLF; - } - //Normalize line endings to CRLF - $body = static::normalizeBreaks($body, self::CRLF); - - //Reduce multiple trailing line breaks to a single one - return static::stripTrailingWSP($body) . self::CRLF; - } - - /** - * Create the DKIM header and body in a new message header. - * - * @param string $headers_line Header lines - * @param string $subject Subject - * @param string $body Body - * - * @throws Exception - * - * @return string - */ - public function DKIM_Add($headers_line, $subject, $body) - { - $DKIMsignatureType = 'rsa-sha256'; //Signature & hash algorithms - $DKIMcanonicalization = 'relaxed/simple'; //Canonicalization methods of header & body - $DKIMquery = 'dns/txt'; //Query method - $DKIMtime = time(); - //Always sign these headers without being asked - //Recommended list from https://tools.ietf.org/html/rfc6376#section-5.4.1 - $autoSignHeaders = [ - 'from', - 'to', - 'cc', - 'date', - 'subject', - 'reply-to', - 'message-id', - 'content-type', - 'mime-version', - 'x-mailer', - ]; - if (stripos($headers_line, 'Subject') === false) { - $headers_line .= 'Subject: ' . $subject . static::$LE; - } - $headerLines = explode(static::$LE, $headers_line); - $currentHeaderLabel = ''; - $currentHeaderValue = ''; - $parsedHeaders = []; - $headerLineIndex = 0; - $headerLineCount = count($headerLines); - foreach ($headerLines as $headerLine) { - $matches = []; - if (preg_match('/^([^ \t]*?)(?::[ \t]*)(.*)$/', $headerLine, $matches)) { - if ($currentHeaderLabel !== '') { - //We were previously in another header; This is the start of a new header, so save the previous one - $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue]; - } - $currentHeaderLabel = $matches[1]; - $currentHeaderValue = $matches[2]; - } elseif (preg_match('/^[ \t]+(.*)$/', $headerLine, $matches)) { - //This is a folded continuation of the current header, so unfold it - $currentHeaderValue .= ' ' . $matches[1]; - } - ++$headerLineIndex; - if ($headerLineIndex >= $headerLineCount) { - //This was the last line, so finish off this header - $parsedHeaders[] = ['label' => $currentHeaderLabel, 'value' => $currentHeaderValue]; - } - } - $copiedHeaders = []; - $headersToSignKeys = []; - $headersToSign = []; - foreach ($parsedHeaders as $header) { - //Is this header one that must be included in the DKIM signature? - if (in_array(strtolower($header['label']), $autoSignHeaders, true)) { - $headersToSignKeys[] = $header['label']; - $headersToSign[] = $header['label'] . ': ' . $header['value']; - if ($this->DKIM_copyHeaderFields) { - $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC - str_replace('|', '=7C', $this->DKIM_QP($header['value'])); - } - continue; - } - //Is this an extra custom header we've been asked to sign? - if (in_array($header['label'], $this->DKIM_extraHeaders, true)) { - //Find its value in custom headers - foreach ($this->CustomHeader as $customHeader) { - if ($customHeader[0] === $header['label']) { - $headersToSignKeys[] = $header['label']; - $headersToSign[] = $header['label'] . ': ' . $header['value']; - if ($this->DKIM_copyHeaderFields) { - $copiedHeaders[] = $header['label'] . ':' . //Note no space after this, as per RFC - str_replace('|', '=7C', $this->DKIM_QP($header['value'])); - } - //Skip straight to the next header - continue 2; - } - } - } - } - $copiedHeaderFields = ''; - if ($this->DKIM_copyHeaderFields && count($copiedHeaders) > 0) { - //Assemble a DKIM 'z' tag - $copiedHeaderFields = ' z='; - $first = true; - foreach ($copiedHeaders as $copiedHeader) { - if (!$first) { - $copiedHeaderFields .= static::$LE . ' |'; - } - //Fold long values - if (strlen($copiedHeader) > self::STD_LINE_LENGTH - 3) { - $copiedHeaderFields .= substr( - chunk_split($copiedHeader, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS), - 0, - -strlen(static::$LE . self::FWS) - ); - } else { - $copiedHeaderFields .= $copiedHeader; - } - $first = false; - } - $copiedHeaderFields .= ';' . static::$LE; - } - $headerKeys = ' h=' . implode(':', $headersToSignKeys) . ';' . static::$LE; - $headerValues = implode(static::$LE, $headersToSign); - $body = $this->DKIM_BodyC($body); - //Base64 of packed binary SHA-256 hash of body - $DKIMb64 = base64_encode(pack('H*', hash('sha256', $body))); - $ident = ''; - if ('' !== $this->DKIM_identity) { - $ident = ' i=' . $this->DKIM_identity . ';' . static::$LE; - } - //The DKIM-Signature header is included in the signature *except for* the value of the `b` tag - //which is appended after calculating the signature - //https://tools.ietf.org/html/rfc6376#section-3.5 - $dkimSignatureHeader = 'DKIM-Signature: v=1;' . - ' d=' . $this->DKIM_domain . ';' . - ' s=' . $this->DKIM_selector . ';' . static::$LE . - ' a=' . $DKIMsignatureType . ';' . - ' q=' . $DKIMquery . ';' . - ' t=' . $DKIMtime . ';' . - ' c=' . $DKIMcanonicalization . ';' . static::$LE . - $headerKeys . - $ident . - $copiedHeaderFields . - ' bh=' . $DKIMb64 . ';' . static::$LE . - ' b='; - //Canonicalize the set of headers - $canonicalizedHeaders = $this->DKIM_HeaderC( - $headerValues . static::$LE . $dkimSignatureHeader - ); - $signature = $this->DKIM_Sign($canonicalizedHeaders); - $signature = trim(chunk_split($signature, self::STD_LINE_LENGTH - 3, static::$LE . self::FWS)); - - return static::normalizeBreaks($dkimSignatureHeader . $signature); - } - - /** - * Detect if a string contains a line longer than the maximum line length - * allowed by RFC 2822 section 2.1.1. - * - * @param string $str - * - * @return bool - */ - public static function hasLineLongerThanMax($str) - { - return (bool) preg_match('/^(.{' . (self::MAX_LINE_LENGTH + strlen(static::$LE)) . ',})/m', $str); - } - - /** - * If a string contains any "special" characters, double-quote the name, - * and escape any double quotes with a backslash. - * - * @param string $str - * - * @return string - * - * @see RFC822 3.4.1 - */ - public static function quotedString($str) - { - if (preg_match('/[ ()<>@,;:"\/\[\]?=]/', $str)) { - //If the string contains any of these chars, it must be double-quoted - //and any double quotes must be escaped with a backslash - return '"' . str_replace('"', '\\"', $str) . '"'; - } - - //Return the string untouched, it doesn't need quoting - return $str; - } - - /** - * Allows for public read access to 'to' property. - * Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * - * @return array - */ - public function getToAddresses() - { - return $this->to; - } - - /** - * Allows for public read access to 'cc' property. - * Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * - * @return array - */ - public function getCcAddresses() - { - return $this->cc; - } - - /** - * Allows for public read access to 'bcc' property. - * Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * - * @return array - */ - public function getBccAddresses() - { - return $this->bcc; - } - - /** - * Allows for public read access to 'ReplyTo' property. - * Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * - * @return array - */ - public function getReplyToAddresses() - { - return $this->ReplyTo; - } - - /** - * Allows for public read access to 'all_recipients' property. - * Before the send() call, queued addresses (i.e. with IDN) are not yet included. - * - * @return array - */ - public function getAllRecipientAddresses() - { - return $this->all_recipients; - } - - /** - * Perform a callback. - * - * @param bool $isSent - * @param array $to - * @param array $cc - * @param array $bcc - * @param string $subject - * @param string $body - * @param string $from - * @param array $extra - */ - protected function doCallback($isSent, $to, $cc, $bcc, $subject, $body, $from, $extra) - { - if (!empty($this->action_function) && is_callable($this->action_function)) { - call_user_func($this->action_function, $isSent, $to, $cc, $bcc, $subject, $body, $from, $extra); - } - } - - /** - * Get the OAuth instance. - * - * @return OAuth - */ - public function getOAuth() - { - return $this->oauth; - } - - /** - * Set an OAuth instance. - */ - public function setOAuth(OAuth $oauth) - { - $this->oauth = $oauth; - } -} diff --git a/app/vendor/phpmailer/phpmailer/src/POP3.php b/app/vendor/phpmailer/phpmailer/src/POP3.php deleted file mode 100644 index b38964b..0000000 --- a/app/vendor/phpmailer/phpmailer/src/POP3.php +++ /dev/null @@ -1,448 +0,0 @@ - - * @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 POP-Before-SMTP Authentication Class. - * Specifically for PHPMailer to use for RFC1939 POP-before-SMTP authentication. - * 1) This class does not support APOP authentication. - * 2) Opening and closing lots of POP3 connections can be quite slow. If you need - * to send a batch of emails then just perform the authentication once at the start, - * and then loop through your mail sending script. Providing this process doesn't - * take longer than the verification period lasts on your POP3 server, you should be fine. - * 3) This is really ancient technology; you should only need to use it to talk to very old systems. - * 4) This POP3 class is deliberately lightweight and incomplete, implementing just - * enough to do authentication. - * If you want a more complete class there are other POP3 classes for PHP available. - * - * @author Richard Davey (original author) - * @author Marcus Bointon (Synchro/coolbru) - * @author Jim Jagielski (jimjag) - * @author Andy Prevost (codeworxtech) - */ -class POP3 -{ - /** - * The POP3 PHPMailer Version number. - * - * @var string - */ - const VERSION = '6.5.0'; - - /** - * Default POP3 port number. - * - * @var int - */ - const DEFAULT_PORT = 110; - - /** - * Default timeout in seconds. - * - * @var int - */ - const DEFAULT_TIMEOUT = 30; - - /** - * POP3 class debug output mode. - * Debug output level. - * Options: - * @see POP3::DEBUG_OFF: No output - * @see POP3::DEBUG_SERVER: Server messages, connection/server errors - * @see POP3::DEBUG_CLIENT: Client and Server messages, connection/server errors - * - * @var int - */ - public $do_debug = self::DEBUG_OFF; - - /** - * POP3 mail server hostname. - * - * @var string - */ - public $host; - - /** - * POP3 port number. - * - * @var int - */ - public $port; - - /** - * POP3 Timeout Value in seconds. - * - * @var int - */ - public $tval; - - /** - * POP3 username. - * - * @var string - */ - public $username; - - /** - * POP3 password. - * - * @var string - */ - public $password; - - /** - * Resource handle for the POP3 connection socket. - * - * @var resource - */ - protected $pop_conn; - - /** - * Are we connected? - * - * @var bool - */ - protected $connected = false; - - /** - * Error container. - * - * @var array - */ - protected $errors = []; - - /** - * Line break constant. - */ - const LE = "\r\n"; - - /** - * Debug level for no output. - * - * @var int - */ - const DEBUG_OFF = 0; - - /** - * Debug level to show server -> client messages - * also shows clients connection errors or errors from server - * - * @var int - */ - const DEBUG_SERVER = 1; - - /** - * Debug level to show client -> server and server -> client messages. - * - * @var int - */ - const DEBUG_CLIENT = 2; - - /** - * Simple static wrapper for all-in-one POP before SMTP. - * - * @param string $host The hostname to connect to - * @param int|bool $port The port number to connect to - * @param int|bool $timeout The timeout value - * @param string $username - * @param string $password - * @param int $debug_level - * - * @return bool - */ - public static function popBeforeSmtp( - $host, - $port = false, - $timeout = false, - $username = '', - $password = '', - $debug_level = 0 - ) { - $pop = new self(); - - return $pop->authorise($host, $port, $timeout, $username, $password, $debug_level); - } - - /** - * Authenticate with a POP3 server. - * A connect, login, disconnect sequence - * appropriate for POP-before SMTP authorisation. - * - * @param string $host The hostname to connect to - * @param int|bool $port The port number to connect to - * @param int|bool $timeout The timeout value - * @param string $username - * @param string $password - * @param int $debug_level - * - * @return bool - */ - public function authorise($host, $port = false, $timeout = false, $username = '', $password = '', $debug_level = 0) - { - $this->host = $host; - //If no port value provided, use default - if (false === $port) { - $this->port = static::DEFAULT_PORT; - } else { - $this->port = (int) $port; - } - //If no timeout value provided, use default - if (false === $timeout) { - $this->tval = static::DEFAULT_TIMEOUT; - } else { - $this->tval = (int) $timeout; - } - $this->do_debug = $debug_level; - $this->username = $username; - $this->password = $password; - //Reset the error log - $this->errors = []; - //Connect - $result = $this->connect($this->host, $this->port, $this->tval); - if ($result) { - $login_result = $this->login($this->username, $this->password); - if ($login_result) { - $this->disconnect(); - - return true; - } - } - //We need to disconnect regardless of whether the login succeeded - $this->disconnect(); - - return false; - } - - /** - * Connect to a POP3 server. - * - * @param string $host - * @param int|bool $port - * @param int $tval - * - * @return bool - */ - public function connect($host, $port = false, $tval = 30) - { - //Are we already connected? - if ($this->connected) { - return true; - } - - //On Windows this will raise a PHP Warning error if the hostname doesn't exist. - //Rather than suppress it with @fsockopen, capture it cleanly instead - set_error_handler([$this, 'catchWarning']); - - if (false === $port) { - $port = static::DEFAULT_PORT; - } - - //Connect to the POP3 server - $errno = 0; - $errstr = ''; - $this->pop_conn = fsockopen( - $host, //POP3 Host - $port, //Port # - $errno, //Error Number - $errstr, //Error Message - $tval - ); //Timeout (seconds) - //Restore the error handler - restore_error_handler(); - - //Did we connect? - if (false === $this->pop_conn) { - //It would appear not... - $this->setError( - "Failed to connect to server $host on port $port. errno: $errno; errstr: $errstr" - ); - - return false; - } - - //Increase the stream time-out - stream_set_timeout($this->pop_conn, $tval, 0); - - //Get the POP3 server response - $pop3_response = $this->getResponse(); - //Check for the +OK - if ($this->checkResponse($pop3_response)) { - //The connection is established and the POP3 server is talking - $this->connected = true; - - return true; - } - - return false; - } - - /** - * Log in to the POP3 server. - * Does not support APOP (RFC 2828, 4949). - * - * @param string $username - * @param string $password - * - * @return bool - */ - public function login($username = '', $password = '') - { - if (!$this->connected) { - $this->setError('Not connected to POP3 server'); - } - if (empty($username)) { - $username = $this->username; - } - if (empty($password)) { - $password = $this->password; - } - - //Send the Username - $this->sendString("USER $username" . static::LE); - $pop3_response = $this->getResponse(); - if ($this->checkResponse($pop3_response)) { - //Send the Password - $this->sendString("PASS $password" . static::LE); - $pop3_response = $this->getResponse(); - if ($this->checkResponse($pop3_response)) { - return true; - } - } - - return false; - } - - /** - * Disconnect from the POP3 server. - */ - public function disconnect() - { - $this->sendString('QUIT'); - //The QUIT command may cause the daemon to exit, which will kill our connection - //So ignore errors here - try { - @fclose($this->pop_conn); - } catch (Exception $e) { - //Do nothing - } - } - - /** - * Get a response from the POP3 server. - * - * @param int $size The maximum number of bytes to retrieve - * - * @return string - */ - protected function getResponse($size = 128) - { - $response = fgets($this->pop_conn, $size); - if ($this->do_debug >= self::DEBUG_SERVER) { - echo 'Server -> Client: ', $response; - } - - return $response; - } - - /** - * Send raw data to the POP3 server. - * - * @param string $string - * - * @return int - */ - protected function sendString($string) - { - if ($this->pop_conn) { - if ($this->do_debug >= self::DEBUG_CLIENT) { //Show client messages when debug >= 2 - echo 'Client -> Server: ', $string; - } - - return fwrite($this->pop_conn, $string, strlen($string)); - } - - return 0; - } - - /** - * Checks the POP3 server response. - * Looks for for +OK or -ERR. - * - * @param string $string - * - * @return bool - */ - protected function checkResponse($string) - { - if (strpos($string, '+OK') !== 0) { - $this->setError("Server reported an error: $string"); - - return false; - } - - return true; - } - - /** - * Add an error to the internal error store. - * Also display debug output if it's enabled. - * - * @param string $error - */ - protected function setError($error) - { - $this->errors[] = $error; - if ($this->do_debug >= self::DEBUG_SERVER) { - echo '
';
-            foreach ($this->errors as $e) {
-                print_r($e);
-            }
-            echo '
'; - } - } - - /** - * Get an array of error messages, if any. - * - * @return array - */ - public function getErrors() - { - return $this->errors; - } - - /** - * POP3 connection error handler. - * - * @param int $errno - * @param string $errstr - * @param string $errfile - * @param int $errline - */ - protected function catchWarning($errno, $errstr, $errfile, $errline) - { - $this->setError( - 'Connecting to the POP3 server raised a PHP warning:' . - "errno: $errno errstr: $errstr; errfile: $errfile; errline: $errline" - ); - } -} diff --git a/app/vendor/phpmailer/phpmailer/src/SMTP.php b/app/vendor/phpmailer/phpmailer/src/SMTP.php deleted file mode 100644 index a4a91ed..0000000 --- a/app/vendor/phpmailer/phpmailer/src/SMTP.php +++ /dev/null @@ -1,1456 +0,0 @@ - - * @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 RFC821 SMTP email transport class. - * Implements RFC 821 SMTP commands and provides some utility methods for sending mail to an SMTP server. - * - * @author Chris Ryan - * @author Marcus Bointon - */ -class SMTP -{ - /** - * The PHPMailer SMTP version number. - * - * @var string - */ - const VERSION = '6.5.0'; - - /** - * SMTP line break constant. - * - * @var string - */ - const LE = "\r\n"; - - /** - * The SMTP port to use if one is not specified. - * - * @var int - */ - const DEFAULT_PORT = 25; - - /** - * The maximum line length allowed by RFC 5321 section 4.5.3.1.6, - * *excluding* a trailing CRLF break. - * - * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.6 - * - * @var int - */ - const MAX_LINE_LENGTH = 998; - - /** - * The maximum line length allowed for replies in RFC 5321 section 4.5.3.1.5, - * *including* a trailing CRLF line break. - * - * @see https://tools.ietf.org/html/rfc5321#section-4.5.3.1.5 - * - * @var int - */ - const MAX_REPLY_LENGTH = 512; - - /** - * Debug level for no output. - * - * @var int - */ - const DEBUG_OFF = 0; - - /** - * Debug level to show client -> server messages. - * - * @var int - */ - const DEBUG_CLIENT = 1; - - /** - * Debug level to show client -> server and server -> client messages. - * - * @var int - */ - const DEBUG_SERVER = 2; - - /** - * Debug level to show connection status, client -> server and server -> client messages. - * - * @var int - */ - const DEBUG_CONNECTION = 3; - - /** - * Debug level to show all messages. - * - * @var int - */ - const DEBUG_LOWLEVEL = 4; - - /** - * Debug output level. - * Options: - * * self::DEBUG_OFF (`0`) No debug output, default - * * self::DEBUG_CLIENT (`1`) Client commands - * * self::DEBUG_SERVER (`2`) Client commands and server responses - * * self::DEBUG_CONNECTION (`3`) As DEBUG_SERVER plus connection status - * * self::DEBUG_LOWLEVEL (`4`) Low-level data output, all messages. - * - * @var int - */ - public $do_debug = self::DEBUG_OFF; - - /** - * 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 - * Alternatively, you can provide a callable expecting two params: a message string and the debug level: - * - * ```php - * $smtp->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; - * ``` - * - * @var string|callable|\Psr\Log\LoggerInterface - */ - public $Debugoutput = 'echo'; - - /** - * Whether to use VERP. - * - * @see http://en.wikipedia.org/wiki/Variable_envelope_return_path - * @see http://www.postfix.org/VERP_README.html Info on VERP - * - * @var bool - */ - public $do_verp = false; - - /** - * The timeout value for connection, in seconds. - * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. - * This needs to be quite high to function correctly with hosts using greetdelay as an anti-spam measure. - * - * @see http://tools.ietf.org/html/rfc2821#section-4.5.3.2 - * - * @var int - */ - public $Timeout = 300; - - /** - * How long to wait for commands to complete, in seconds. - * Default of 5 minutes (300sec) is from RFC2821 section 4.5.3.2. - * - * @var int - */ - public $Timelimit = 300; - - /** - * Patterns to extract an SMTP transaction id from reply to a DATA command. - * The first capture group in each regex will be used as the ID. - * MS ESMTP returns the message ID, which may not be correct for internal tracking. - * - * @var string[] - */ - protected $smtp_transaction_id_patterns = [ - 'exim' => '/[\d]{3} OK id=(.*)/', - 'sendmail' => '/[\d]{3} 2.0.0 (.*) Message/', - 'postfix' => '/[\d]{3} 2.0.0 Ok: queued as (.*)/', - 'Microsoft_ESMTP' => '/[0-9]{3} 2.[\d].0 (.*)@(?:.*) Queued mail for delivery/', - 'Amazon_SES' => '/[\d]{3} Ok (.*)/', - 'SendGrid' => '/[\d]{3} Ok: queued as (.*)/', - 'CampaignMonitor' => '/[\d]{3} 2.0.0 OK:([a-zA-Z\d]{48})/', - 'Haraka' => '/[\d]{3} Message Queued \((.*)\)/', - ]; - - /** - * The last transaction ID issued in response to a DATA command, - * if one was detected. - * - * @var string|bool|null - */ - protected $last_smtp_transaction_id; - - /** - * The socket for the server connection. - * - * @var ?resource - */ - protected $smtp_conn; - - /** - * Error information, if any, for the last SMTP command. - * - * @var array - */ - protected $error = [ - 'error' => '', - 'detail' => '', - 'smtp_code' => '', - 'smtp_code_ex' => '', - ]; - - /** - * The reply the server sent to us for HELO. - * If null, no HELO string has yet been received. - * - * @var string|null - */ - protected $helo_rply; - - /** - * The set of SMTP extensions sent in reply to EHLO command. - * Indexes of the array are extension names. - * Value at index 'HELO' or 'EHLO' (according to command that was sent) - * represents the server name. In case of HELO it is the only element of the array. - * Other values can be boolean TRUE or an array containing extension options. - * If null, no HELO/EHLO string has yet been received. - * - * @var array|null - */ - protected $server_caps; - - /** - * The most recent reply received from the server. - * - * @var string - */ - protected $last_reply = ''; - - /** - * Output debugging info via a user-selected method. - * - * @param string $str Debug string to output - * @param int $level The debug level of this message; see DEBUG_* constants - * - * @see SMTP::$Debugoutput - * @see SMTP::$do_debug - */ - protected function edebug($str, $level = 0) - { - if ($level > $this->do_debug) { - 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, $level); - - return; - } - switch ($this->Debugoutput) { - case 'error_log': - //Don't output, just log - error_log($str); - break; - case 'html': - //Cleans up output a bit for a better looking, HTML-safe output - echo gmdate('Y-m-d H:i:s'), ' ', 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"; - } - } - - /** - * Connect to an SMTP server. - * - * @param string $host SMTP server IP or host name - * @param int $port The port number to connect to - * @param int $timeout How long to wait for the connection to open - * @param array $options An array of options for stream_context_create() - * - * @return bool - */ - public function connect($host, $port = null, $timeout = 30, $options = []) - { - //Clear errors to avoid confusion - $this->setError(''); - //Make sure we are __not__ connected - if ($this->connected()) { - //Already connected, generate error - $this->setError('Already connected to a server'); - - return false; - } - if (empty($port)) { - $port = self::DEFAULT_PORT; - } - //Connect to the SMTP server - $this->edebug( - "Connection: opening to $host:$port, timeout=$timeout, options=" . - (count($options) > 0 ? var_export($options, true) : 'array()'), - self::DEBUG_CONNECTION - ); - - $this->smtp_conn = $this->getSMTPConnection($host, $port, $timeout, $options); - - if ($this->smtp_conn === false) { - //Error info already set inside `getSMTPConnection()` - return false; - } - - $this->edebug('Connection: opened', self::DEBUG_CONNECTION); - - //Get any announcement - $this->last_reply = $this->get_lines(); - $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); - $responseCode = (int)substr($this->last_reply, 0, 3); - if ($responseCode === 220) { - return true; - } - //Anything other than a 220 response means something went wrong - //RFC 5321 says the server will wait for us to send a QUIT in response to a 554 error - //https://tools.ietf.org/html/rfc5321#section-3.1 - if ($responseCode === 554) { - $this->quit(); - } - //This will handle 421 responses which may not wait for a QUIT (e.g. if the server is being shut down) - $this->edebug('Connection: closing due to error', self::DEBUG_CONNECTION); - $this->close(); - return false; - } - - /** - * Create connection to the SMTP server. - * - * @param string $host SMTP server IP or host name - * @param int $port The port number to connect to - * @param int $timeout How long to wait for the connection to open - * @param array $options An array of options for stream_context_create() - * - * @return false|resource - */ - protected function getSMTPConnection($host, $port = null, $timeout = 30, $options = []) - { - static $streamok; - //This is enabled by default since 5.0.0 but some providers disable it - //Check this once and cache the result - if (null === $streamok) { - $streamok = function_exists('stream_socket_client'); - } - - $errno = 0; - $errstr = ''; - if ($streamok) { - $socket_context = stream_context_create($options); - set_error_handler([$this, 'errorHandler']); - $connection = stream_socket_client( - $host . ':' . $port, - $errno, - $errstr, - $timeout, - STREAM_CLIENT_CONNECT, - $socket_context - ); - restore_error_handler(); - } else { - //Fall back to fsockopen which should work in more places, but is missing some features - $this->edebug( - 'Connection: stream_socket_client not available, falling back to fsockopen', - self::DEBUG_CONNECTION - ); - set_error_handler([$this, 'errorHandler']); - $connection = fsockopen( - $host, - $port, - $errno, - $errstr, - $timeout - ); - restore_error_handler(); - } - - //Verify we connected properly - if (!is_resource($connection)) { - $this->setError( - 'Failed to connect to server', - '', - (string) $errno, - $errstr - ); - $this->edebug( - 'SMTP ERROR: ' . $this->error['error'] - . ": $errstr ($errno)", - self::DEBUG_CLIENT - ); - - return false; - } - - //SMTP server can take longer to respond, give longer timeout for first read - //Windows does not have support for this timeout function - if (strpos(PHP_OS, 'WIN') !== 0) { - $max = (int)ini_get('max_execution_time'); - //Don't bother if unlimited, or if set_time_limit is disabled - if (0 !== $max && $timeout > $max && strpos(ini_get('disable_functions'), 'set_time_limit') === false) { - @set_time_limit($timeout); - } - stream_set_timeout($connection, $timeout, 0); - } - - return $connection; - } - - /** - * Initiate a TLS (encrypted) session. - * - * @return bool - */ - public function startTLS() - { - if (!$this->sendCommand('STARTTLS', 'STARTTLS', 220)) { - return false; - } - - //Allow the best TLS version(s) we can - $crypto_method = STREAM_CRYPTO_METHOD_TLS_CLIENT; - - //PHP 5.6.7 dropped inclusion of TLS 1.1 and 1.2 in STREAM_CRYPTO_METHOD_TLS_CLIENT - //so add them back in manually if we can - if (defined('STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT')) { - $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_2_CLIENT; - $crypto_method |= STREAM_CRYPTO_METHOD_TLSv1_1_CLIENT; - } - - //Begin encrypted connection - set_error_handler([$this, 'errorHandler']); - $crypto_ok = stream_socket_enable_crypto( - $this->smtp_conn, - true, - $crypto_method - ); - restore_error_handler(); - - return (bool) $crypto_ok; - } - - /** - * Perform SMTP authentication. - * Must be run after hello(). - * - * @see hello() - * - * @param string $username The user name - * @param string $password The password - * @param string $authtype The auth type (CRAM-MD5, PLAIN, LOGIN, XOAUTH2) - * @param OAuth $OAuth An optional OAuth instance for XOAUTH2 authentication - * - * @return bool True if successfully authenticated - */ - public function authenticate( - $username, - $password, - $authtype = null, - $OAuth = null - ) { - if (!$this->server_caps) { - $this->setError('Authentication is not allowed before HELO/EHLO'); - - return false; - } - - if (array_key_exists('EHLO', $this->server_caps)) { - //SMTP extensions are available; try to find a proper authentication method - if (!array_key_exists('AUTH', $this->server_caps)) { - $this->setError('Authentication is not allowed at this stage'); - //'at this stage' means that auth may be allowed after the stage changes - //e.g. after STARTTLS - - return false; - } - - $this->edebug('Auth method requested: ' . ($authtype ?: 'UNSPECIFIED'), self::DEBUG_LOWLEVEL); - $this->edebug( - 'Auth methods available on the server: ' . implode(',', $this->server_caps['AUTH']), - self::DEBUG_LOWLEVEL - ); - - //If we have requested a specific auth type, check the server supports it before trying others - if (null !== $authtype && !in_array($authtype, $this->server_caps['AUTH'], true)) { - $this->edebug('Requested auth method not available: ' . $authtype, self::DEBUG_LOWLEVEL); - $authtype = null; - } - - if (empty($authtype)) { - //If no auth mechanism is specified, attempt to use these, in this order - //Try CRAM-MD5 first as it's more secure than the others - foreach (['CRAM-MD5', 'LOGIN', 'PLAIN', 'XOAUTH2'] as $method) { - if (in_array($method, $this->server_caps['AUTH'], true)) { - $authtype = $method; - break; - } - } - if (empty($authtype)) { - $this->setError('No supported authentication methods found'); - - return false; - } - $this->edebug('Auth method selected: ' . $authtype, self::DEBUG_LOWLEVEL); - } - - if (!in_array($authtype, $this->server_caps['AUTH'], true)) { - $this->setError("The requested authentication method \"$authtype\" is not supported by the server"); - - return false; - } - } elseif (empty($authtype)) { - $authtype = 'LOGIN'; - } - switch ($authtype) { - case 'PLAIN': - //Start authentication - if (!$this->sendCommand('AUTH', 'AUTH PLAIN', 334)) { - return false; - } - //Send encoded username and password - if ( - //Format from https://tools.ietf.org/html/rfc4616#section-2 - //We skip the first field (it's forgery), so the string starts with a null byte - !$this->sendCommand( - 'User & Password', - base64_encode("\0" . $username . "\0" . $password), - 235 - ) - ) { - return false; - } - break; - case 'LOGIN': - //Start authentication - if (!$this->sendCommand('AUTH', 'AUTH LOGIN', 334)) { - return false; - } - if (!$this->sendCommand('Username', base64_encode($username), 334)) { - return false; - } - if (!$this->sendCommand('Password', base64_encode($password), 235)) { - return false; - } - break; - case 'CRAM-MD5': - //Start authentication - if (!$this->sendCommand('AUTH CRAM-MD5', 'AUTH CRAM-MD5', 334)) { - return false; - } - //Get the challenge - $challenge = base64_decode(substr($this->last_reply, 4)); - - //Build the response - $response = $username . ' ' . $this->hmac($challenge, $password); - - //send encoded credentials - return $this->sendCommand('Username', base64_encode($response), 235); - case 'XOAUTH2': - //The OAuth instance must be set up prior to requesting auth. - if (null === $OAuth) { - return false; - } - $oauth = $OAuth->getOauth64(); - - //Start authentication - if (!$this->sendCommand('AUTH', 'AUTH XOAUTH2 ' . $oauth, 235)) { - return false; - } - break; - default: - $this->setError("Authentication method \"$authtype\" is not supported"); - - return false; - } - - return true; - } - - /** - * Calculate an MD5 HMAC hash. - * Works like hash_hmac('md5', $data, $key) - * in case that function is not available. - * - * @param string $data The data to hash - * @param string $key The key to hash with - * - * @return string - */ - protected function hmac($data, $key) - { - if (function_exists('hash_hmac')) { - return hash_hmac('md5', $data, $key); - } - - //The following borrowed from - //http://php.net/manual/en/function.mhash.php#27225 - - //RFC 2104 HMAC implementation for php. - //Creates an md5 HMAC. - //Eliminates the need to install mhash to compute a HMAC - //by Lance Rushing - - $bytelen = 64; //byte length for md5 - if (strlen($key) > $bytelen) { - $key = pack('H*', md5($key)); - } - $key = str_pad($key, $bytelen, chr(0x00)); - $ipad = str_pad('', $bytelen, chr(0x36)); - $opad = str_pad('', $bytelen, chr(0x5c)); - $k_ipad = $key ^ $ipad; - $k_opad = $key ^ $opad; - - return md5($k_opad . pack('H*', md5($k_ipad . $data))); - } - - /** - * Check connection state. - * - * @return bool True if connected - */ - public function connected() - { - if (is_resource($this->smtp_conn)) { - $sock_status = stream_get_meta_data($this->smtp_conn); - if ($sock_status['eof']) { - //The socket is valid but we are not connected - $this->edebug( - 'SMTP NOTICE: EOF caught while checking if connected', - self::DEBUG_CLIENT - ); - $this->close(); - - return false; - } - - return true; //everything looks good - } - - return false; - } - - /** - * Close the socket and clean up the state of the class. - * Don't use this function without first trying to use QUIT. - * - * @see quit() - */ - public function close() - { - $this->setError(''); - $this->server_caps = null; - $this->helo_rply = null; - if (is_resource($this->smtp_conn)) { - //Close the connection and cleanup - fclose($this->smtp_conn); - $this->smtp_conn = null; //Makes for cleaner serialization - $this->edebug('Connection: closed', self::DEBUG_CONNECTION); - } - } - - /** - * Send an SMTP DATA command. - * Issues a data command and sends the msg_data to the server, - * finializing the mail transaction. $msg_data is the message - * that is to be send with the headers. Each header needs to be - * on a single line followed by a with the message headers - * and the message body being separated by an additional . - * Implements RFC 821: DATA . - * - * @param string $msg_data Message data to send - * - * @return bool - */ - public function data($msg_data) - { - //This will use the standard timelimit - if (!$this->sendCommand('DATA', 'DATA', 354)) { - return false; - } - - /* The server is ready to accept data! - * According to rfc821 we should not send more than 1000 characters on a single line (including the LE) - * so we will break the data up into lines by \r and/or \n then if needed we will break each of those into - * smaller lines to fit within the limit. - * We will also look for lines that start with a '.' and prepend an additional '.'. - * NOTE: this does not count towards line-length limit. - */ - - //Normalize line breaks before exploding - $lines = explode("\n", str_replace(["\r\n", "\r"], "\n", $msg_data)); - - /* To distinguish between a complete RFC822 message and a plain message body, we check if the first field - * of the first line (':' separated) does not contain a space then it _should_ be a header and we will - * process all lines before a blank line as headers. - */ - - $field = substr($lines[0], 0, strpos($lines[0], ':')); - $in_headers = false; - if (!empty($field) && strpos($field, ' ') === false) { - $in_headers = true; - } - - foreach ($lines as $line) { - $lines_out = []; - if ($in_headers && $line === '') { - $in_headers = false; - } - //Break this line up into several smaller lines if it's too long - //Micro-optimisation: isset($str[$len]) is faster than (strlen($str) > $len), - while (isset($line[self::MAX_LINE_LENGTH])) { - //Working backwards, try to find a space within the last MAX_LINE_LENGTH chars of the line to break on - //so as to avoid breaking in the middle of a word - $pos = strrpos(substr($line, 0, self::MAX_LINE_LENGTH), ' '); - //Deliberately matches both false and 0 - if (!$pos) { - //No nice break found, add a hard break - $pos = self::MAX_LINE_LENGTH - 1; - $lines_out[] = substr($line, 0, $pos); - $line = substr($line, $pos); - } else { - //Break at the found point - $lines_out[] = substr($line, 0, $pos); - //Move along by the amount we dealt with - $line = substr($line, $pos + 1); - } - //If processing headers add a LWSP-char to the front of new line RFC822 section 3.1.1 - if ($in_headers) { - $line = "\t" . $line; - } - } - $lines_out[] = $line; - - //Send the lines to the server - foreach ($lines_out as $line_out) { - //Dot-stuffing as per RFC5321 section 4.5.2 - //https://tools.ietf.org/html/rfc5321#section-4.5.2 - if (!empty($line_out) && $line_out[0] === '.') { - $line_out = '.' . $line_out; - } - $this->client_send($line_out . static::LE, 'DATA'); - } - } - - //Message data has been sent, complete the command - //Increase timelimit for end of DATA command - $savetimelimit = $this->Timelimit; - $this->Timelimit *= 2; - $result = $this->sendCommand('DATA END', '.', 250); - $this->recordLastTransactionID(); - //Restore timelimit - $this->Timelimit = $savetimelimit; - - return $result; - } - - /** - * Send an SMTP HELO or EHLO command. - * Used to identify the sending server to the receiving server. - * This makes sure that client and server are in a known state. - * Implements RFC 821: HELO - * and RFC 2821 EHLO. - * - * @param string $host The host name or IP to connect to - * - * @return bool - */ - public function hello($host = '') - { - //Try extended hello first (RFC 2821) - if ($this->sendHello('EHLO', $host)) { - return true; - } - - //Some servers shut down the SMTP service here (RFC 5321) - if (substr($this->helo_rply, 0, 3) == '421') { - return false; - } - - return $this->sendHello('HELO', $host); - } - - /** - * Send an SMTP HELO or EHLO command. - * Low-level implementation used by hello(). - * - * @param string $hello The HELO string - * @param string $host The hostname to say we are - * - * @return bool - * - * @see hello() - */ - protected function sendHello($hello, $host) - { - $noerror = $this->sendCommand($hello, $hello . ' ' . $host, 250); - $this->helo_rply = $this->last_reply; - if ($noerror) { - $this->parseHelloFields($hello); - } else { - $this->server_caps = null; - } - - return $noerror; - } - - /** - * Parse a reply to HELO/EHLO command to discover server extensions. - * In case of HELO, the only parameter that can be discovered is a server name. - * - * @param string $type `HELO` or `EHLO` - */ - protected function parseHelloFields($type) - { - $this->server_caps = []; - $lines = explode("\n", $this->helo_rply); - - foreach ($lines as $n => $s) { - //First 4 chars contain response code followed by - or space - $s = trim(substr($s, 4)); - if (empty($s)) { - continue; - } - $fields = explode(' ', $s); - if (!empty($fields)) { - if (!$n) { - $name = $type; - $fields = $fields[0]; - } else { - $name = array_shift($fields); - switch ($name) { - case 'SIZE': - $fields = ($fields ? $fields[0] : 0); - break; - case 'AUTH': - if (!is_array($fields)) { - $fields = []; - } - break; - default: - $fields = true; - } - } - $this->server_caps[$name] = $fields; - } - } - } - - /** - * Send an SMTP MAIL command. - * Starts a mail transaction from the email address specified in - * $from. Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more recipient - * commands may be called followed by a data command. - * Implements RFC 821: MAIL FROM: . - * - * @param string $from Source address of this message - * - * @return bool - */ - public function mail($from) - { - $useVerp = ($this->do_verp ? ' XVERP' : ''); - - return $this->sendCommand( - 'MAIL FROM', - 'MAIL FROM:<' . $from . '>' . $useVerp, - 250 - ); - } - - /** - * Send an SMTP QUIT command. - * Closes the socket if there is no error or the $close_on_error argument is true. - * Implements from RFC 821: QUIT . - * - * @param bool $close_on_error Should the connection close if an error occurs? - * - * @return bool - */ - public function quit($close_on_error = true) - { - $noerror = $this->sendCommand('QUIT', 'QUIT', 221); - $err = $this->error; //Save any error - if ($noerror || $close_on_error) { - $this->close(); - $this->error = $err; //Restore any error from the quit command - } - - return $noerror; - } - - /** - * Send an SMTP RCPT command. - * Sets the TO argument to $toaddr. - * Returns true if the recipient was accepted false if it was rejected. - * Implements from RFC 821: RCPT TO: . - * - * @param string $address The address the message is being sent to - * @param string $dsn Comma separated list of DSN notifications. NEVER, SUCCESS, FAILURE - * or DELAY. If you specify NEVER all other notifications are ignored. - * - * @return bool - */ - public function recipient($address, $dsn = '') - { - if (empty($dsn)) { - $rcpt = 'RCPT TO:<' . $address . '>'; - } else { - $dsn = strtoupper($dsn); - $notify = []; - - if (strpos($dsn, 'NEVER') !== false) { - $notify[] = 'NEVER'; - } else { - foreach (['SUCCESS', 'FAILURE', 'DELAY'] as $value) { - if (strpos($dsn, $value) !== false) { - $notify[] = $value; - } - } - } - - $rcpt = 'RCPT TO:<' . $address . '> NOTIFY=' . implode(',', $notify); - } - - return $this->sendCommand( - 'RCPT TO', - $rcpt, - [250, 251] - ); - } - - /** - * Send an SMTP RSET command. - * Abort any transaction that is currently in progress. - * Implements RFC 821: RSET . - * - * @return bool True on success - */ - public function reset() - { - return $this->sendCommand('RSET', 'RSET', 250); - } - - /** - * Send a command to an SMTP server and check its return code. - * - * @param string $command The command name - not sent to the server - * @param string $commandstring The actual command to send - * @param int|array $expect One or more expected integer success codes - * - * @return bool True on success - */ - protected function sendCommand($command, $commandstring, $expect) - { - if (!$this->connected()) { - $this->setError("Called $command without being connected"); - - return false; - } - //Reject line breaks in all commands - if ((strpos($commandstring, "\n") !== false) || (strpos($commandstring, "\r") !== false)) { - $this->setError("Command '$command' contained line breaks"); - - return false; - } - $this->client_send($commandstring . static::LE, $command); - - $this->last_reply = $this->get_lines(); - //Fetch SMTP code and possible error code explanation - $matches = []; - if (preg_match('/^([\d]{3})[ -](?:([\d]\\.[\d]\\.[\d]{1,2}) )?/', $this->last_reply, $matches)) { - $code = (int) $matches[1]; - $code_ex = (count($matches) > 2 ? $matches[2] : null); - //Cut off error code from each response line - $detail = preg_replace( - "/{$code}[ -]" . - ($code_ex ? str_replace('.', '\\.', $code_ex) . ' ' : '') . '/m', - '', - $this->last_reply - ); - } else { - //Fall back to simple parsing if regex fails - $code = (int) substr($this->last_reply, 0, 3); - $code_ex = null; - $detail = substr($this->last_reply, 4); - } - - $this->edebug('SERVER -> CLIENT: ' . $this->last_reply, self::DEBUG_SERVER); - - if (!in_array($code, (array) $expect, true)) { - $this->setError( - "$command command failed", - $detail, - $code, - $code_ex - ); - $this->edebug( - 'SMTP ERROR: ' . $this->error['error'] . ': ' . $this->last_reply, - self::DEBUG_CLIENT - ); - - return false; - } - - $this->setError(''); - - return true; - } - - /** - * Send an SMTP SAML command. - * Starts a mail transaction from the email address specified in $from. - * Returns true if successful or false otherwise. If True - * the mail transaction is started and then one or more recipient - * commands may be called followed by a data command. This command - * will send the message to the users terminal if they are logged - * in and send them an email. - * Implements RFC 821: SAML FROM: . - * - * @param string $from The address the message is from - * - * @return bool - */ - public function sendAndMail($from) - { - return $this->sendCommand('SAML', "SAML FROM:$from", 250); - } - - /** - * Send an SMTP VRFY command. - * - * @param string $name The name to verify - * - * @return bool - */ - public function verify($name) - { - return $this->sendCommand('VRFY', "VRFY $name", [250, 251]); - } - - /** - * Send an SMTP NOOP command. - * Used to keep keep-alives alive, doesn't actually do anything. - * - * @return bool - */ - public function noop() - { - return $this->sendCommand('NOOP', 'NOOP', 250); - } - - /** - * Send an SMTP TURN command. - * This is an optional command for SMTP that this class does not support. - * This method is here to make the RFC821 Definition complete for this class - * and _may_ be implemented in future. - * Implements from RFC 821: TURN . - * - * @return bool - */ - public function turn() - { - $this->setError('The SMTP TURN command is not implemented'); - $this->edebug('SMTP NOTICE: ' . $this->error['error'], self::DEBUG_CLIENT); - - return false; - } - - /** - * Send raw data to the server. - * - * @param string $data The data to send - * @param string $command Optionally, the command this is part of, used only for controlling debug output - * - * @return int|bool The number of bytes sent to the server or false on error - */ - public function client_send($data, $command = '') - { - //If SMTP transcripts are left enabled, or debug output is posted online - //it can leak credentials, so hide credentials in all but lowest level - if ( - self::DEBUG_LOWLEVEL > $this->do_debug && - in_array($command, ['User & Password', 'Username', 'Password'], true) - ) { - $this->edebug('CLIENT -> SERVER: [credentials hidden]', self::DEBUG_CLIENT); - } else { - $this->edebug('CLIENT -> SERVER: ' . $data, self::DEBUG_CLIENT); - } - set_error_handler([$this, 'errorHandler']); - $result = fwrite($this->smtp_conn, $data); - restore_error_handler(); - - return $result; - } - - /** - * Get the latest error. - * - * @return array - */ - public function getError() - { - return $this->error; - } - - /** - * Get SMTP extensions available on the server. - * - * @return array|null - */ - public function getServerExtList() - { - return $this->server_caps; - } - - /** - * Get metadata about the SMTP server from its HELO/EHLO response. - * The method works in three ways, dependent on argument value and current state: - * 1. HELO/EHLO has not been sent - returns null and populates $this->error. - * 2. HELO has been sent - - * $name == 'HELO': returns server name - * $name == 'EHLO': returns boolean false - * $name == any other string: returns null and populates $this->error - * 3. EHLO has been sent - - * $name == 'HELO'|'EHLO': returns the server name - * $name == any other string: if extension $name exists, returns True - * or its options (e.g. AUTH mechanisms supported). Otherwise returns False. - * - * @param string $name Name of SMTP extension or 'HELO'|'EHLO' - * - * @return string|bool|null - */ - public function getServerExt($name) - { - if (!$this->server_caps) { - $this->setError('No HELO/EHLO was sent'); - - return; - } - - if (!array_key_exists($name, $this->server_caps)) { - if ('HELO' === $name) { - return $this->server_caps['EHLO']; - } - if ('EHLO' === $name || array_key_exists('EHLO', $this->server_caps)) { - return false; - } - $this->setError('HELO handshake was used; No information about server extensions available'); - - return; - } - - return $this->server_caps[$name]; - } - - /** - * Get the last reply from the server. - * - * @return string - */ - public function getLastReply() - { - return $this->last_reply; - } - - /** - * Read the SMTP server's response. - * Either before eof or socket timeout occurs on the operation. - * With SMTP we can tell if we have more lines to read if the - * 4th character is '-' symbol. If it is a space then we don't - * need to read anything else. - * - * @return string - */ - protected function get_lines() - { - //If the connection is bad, give up straight away - if (!is_resource($this->smtp_conn)) { - return ''; - } - $data = ''; - $endtime = 0; - stream_set_timeout($this->smtp_conn, $this->Timeout); - if ($this->Timelimit > 0) { - $endtime = time() + $this->Timelimit; - } - $selR = [$this->smtp_conn]; - $selW = null; - while (is_resource($this->smtp_conn) && !feof($this->smtp_conn)) { - //Must pass vars in here as params are by reference - //solution for signals inspired by https://github.com/symfony/symfony/pull/6540 - set_error_handler([$this, 'errorHandler']); - $n = stream_select($selR, $selW, $selW, $this->Timelimit); - restore_error_handler(); - - if ($n === false) { - $message = $this->getError()['detail']; - - $this->edebug( - 'SMTP -> get_lines(): select failed (' . $message . ')', - self::DEBUG_LOWLEVEL - ); - - //stream_select returns false when the `select` system call is interrupted - //by an incoming signal, try the select again - if (stripos($message, 'interrupted system call') !== false) { - $this->edebug( - 'SMTP -> get_lines(): retrying stream_select', - self::DEBUG_LOWLEVEL - ); - $this->setError(''); - continue; - } - - break; - } - - if (!$n) { - $this->edebug( - 'SMTP -> get_lines(): select timed-out in (' . $this->Timelimit . ' sec)', - self::DEBUG_LOWLEVEL - ); - break; - } - - //Deliberate noise suppression - errors are handled afterwards - $str = @fgets($this->smtp_conn, self::MAX_REPLY_LENGTH); - $this->edebug('SMTP INBOUND: "' . trim($str) . '"', self::DEBUG_LOWLEVEL); - $data .= $str; - //If response is only 3 chars (not valid, but RFC5321 S4.2 says it must be handled), - //or 4th character is a space or a line break char, we are done reading, break the loop. - //String array access is a significant micro-optimisation over strlen - if (!isset($str[3]) || $str[3] === ' ' || $str[3] === "\r" || $str[3] === "\n") { - break; - } - //Timed-out? Log and break - $info = stream_get_meta_data($this->smtp_conn); - if ($info['timed_out']) { - $this->edebug( - 'SMTP -> get_lines(): stream timed-out (' . $this->Timeout . ' sec)', - self::DEBUG_LOWLEVEL - ); - break; - } - //Now check if reads took too long - if ($endtime && time() > $endtime) { - $this->edebug( - 'SMTP -> get_lines(): timelimit reached (' . - $this->Timelimit . ' sec)', - self::DEBUG_LOWLEVEL - ); - break; - } - } - - return $data; - } - - /** - * Enable or disable VERP address generation. - * - * @param bool $enabled - */ - public function setVerp($enabled = false) - { - $this->do_verp = $enabled; - } - - /** - * Get VERP address generation mode. - * - * @return bool - */ - public function getVerp() - { - return $this->do_verp; - } - - /** - * Set error messages and codes. - * - * @param string $message The error message - * @param string $detail Further detail on the error - * @param string $smtp_code An associated SMTP error code - * @param string $smtp_code_ex Extended SMTP code - */ - protected function setError($message, $detail = '', $smtp_code = '', $smtp_code_ex = '') - { - $this->error = [ - 'error' => $message, - 'detail' => $detail, - 'smtp_code' => $smtp_code, - 'smtp_code_ex' => $smtp_code_ex, - ]; - } - - /** - * Set debug output method. - * - * @param string|callable $method The name of the mechanism to use for debugging output, or a callable to handle it - */ - public function setDebugOutput($method = 'echo') - { - $this->Debugoutput = $method; - } - - /** - * Get debug output method. - * - * @return string - */ - public function getDebugOutput() - { - return $this->Debugoutput; - } - - /** - * Set debug output level. - * - * @param int $level - */ - public function setDebugLevel($level = 0) - { - $this->do_debug = $level; - } - - /** - * Get debug output level. - * - * @return int - */ - public function getDebugLevel() - { - return $this->do_debug; - } - - /** - * Set SMTP timeout. - * - * @param int $timeout The timeout duration in seconds - */ - public function setTimeout($timeout = 0) - { - $this->Timeout = $timeout; - } - - /** - * Get SMTP timeout. - * - * @return int - */ - public function getTimeout() - { - return $this->Timeout; - } - - /** - * Reports an error number and string. - * - * @param int $errno The error number returned by PHP - * @param string $errmsg The error message returned by PHP - * @param string $errfile The file the error occurred in - * @param int $errline The line number the error occurred on - */ - protected function errorHandler($errno, $errmsg, $errfile = '', $errline = 0) - { - $notice = 'Connection failed.'; - $this->setError( - $notice, - $errmsg, - (string) $errno - ); - $this->edebug( - "$notice Error #$errno: $errmsg [$errfile line $errline]", - self::DEBUG_CONNECTION - ); - } - - /** - * Extract and return the ID of the last SMTP transaction based on - * a list of patterns provided in SMTP::$smtp_transaction_id_patterns. - * Relies on the host providing the ID in response to a DATA command. - * If no reply has been received yet, it will return null. - * If no pattern was matched, it will return false. - * - * @return bool|string|null - */ - protected function recordLastTransactionID() - { - $reply = $this->getLastReply(); - - if (empty($reply)) { - $this->last_smtp_transaction_id = null; - } else { - $this->last_smtp_transaction_id = false; - foreach ($this->smtp_transaction_id_patterns as $smtp_transaction_id_pattern) { - $matches = []; - if (preg_match($smtp_transaction_id_pattern, $reply, $matches)) { - $this->last_smtp_transaction_id = trim($matches[1]); - break; - } - } - } - - return $this->last_smtp_transaction_id; - } - - /** - * Get the queue/transaction ID of the last SMTP transaction - * If no reply has been received yet, it will return null. - * If no pattern was matched, it will return false. - * - * @return bool|string|null - * - * @see recordLastTransactionID() - */ - public function getLastTransactionID() - { - return $this->last_smtp_transaction_id; - } -} diff --git a/app/vendor/recaptchalib.php b/app/vendor/recaptchalib.php deleted file mode 100644 index f67d2f7..0000000 --- a/app/vendor/recaptchalib.php +++ /dev/null @@ -1,279 +0,0 @@ - $value ) - $req .= $key . '=' . urlencode( stripslashes($value) ) . '&'; - - // Cut the last '&' - $req=substr($req,0,strlen($req)-1); - return $req; -} - - - -/** - * Submits an HTTP POST to a reCAPTCHA server - * @param string $host - * @param string $path - * @param array $data - * @param int port - * @return array response - */ -function _recaptcha_http_post($host, $path, $data, $port = 80) { - - $req = _recaptcha_qsencode ($data); - - $http_request = "POST $path HTTP/1.0\r\n"; - $http_request .= "Host: $host\r\n"; - $http_request .= "Content-Type: application/x-www-form-urlencoded;\r\n"; - $http_request .= "Content-Length: " . strlen($req) . "\r\n"; - $http_request .= "User-Agent: reCAPTCHA/PHP\r\n"; - $http_request .= "\r\n"; - $http_request .= $req; - - $response = ''; - if( false == ( $fs = @fsockopen(gethostbyname($host), $port, $errno, $errstr, 10) ) ) { - die ('Could not open socket'); - } - - fwrite($fs, $http_request); - - while ( !feof($fs) ) - $response .= fgets($fs, 1160); // One TCP-IP packet - fclose($fs); - $response = explode("\r\n\r\n", $response, 2); - - return $response; -} - - - -/** - * Gets the challenge HTML (javascript and non-javascript version). - * This is called from the browser, and the resulting reCAPTCHA HTML widget - * is embedded within the HTML form it was called from. - * @param string $pubkey A public key for reCAPTCHA - * @param string $error The error given by reCAPTCHA (optional, default is null) - * @param boolean $use_ssl Should the request be made over ssl? (optional, default is false) - - * @return string - The HTML to be embedded in the user's form. - */ -function recaptcha_get_html($pubkey, $error = null, $use_ssl = false) -{ - if ($pubkey == null || $pubkey == '') { - die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); - } - - if(!$use_ssl and !empty($_SERVER['HTTPS']) and $_SERVER['HTTPS'] != 'off') { - $use_ssl = true; - } - - if ($use_ssl) { - $server = RECAPTCHA_API_SECURE_SERVER; - } else { - $server = RECAPTCHA_API_SERVER; - } - - $errorpart = ""; - if ($error) { - $errorpart = "&error=" . $error; - } - return ' - - '; -} - - - - -/** - * A ReCaptchaResponse is returned from recaptcha_check_answer() - */ -class ReCaptchaResponse { - var $is_valid; - var $error; -} - - -/** - * Calls an HTTP POST function to verify if the user's guess was correct - * @param string $privkey - * @param string $remoteip - * @param string $challenge - * @param string $response - * @param array $extra_params an array of extra variables to post to the server - * @return ReCaptchaResponse - */ -function recaptcha_check_answer ($privkey, $remoteip, $challenge, $response, $extra_params = array()) -{ - if ($privkey == null || $privkey == '') { - die ("To use reCAPTCHA you must get an API key from https://www.google.com/recaptcha/admin/create"); - } - - if ($remoteip == null || $remoteip == '') { - die ("For security reasons, you must pass the remote ip to reCAPTCHA"); - } - - - - //discard spam submissions - if ($challenge == null || strlen($challenge) == 0 || $response == null || strlen($response) == 0) { - $recaptcha_response = new ReCaptchaResponse(); - $recaptcha_response->is_valid = false; - $recaptcha_response->error = 'incorrect-captcha-sol'; - return $recaptcha_response; - } - - $response = _recaptcha_http_post (RECAPTCHA_VERIFY_SERVER, "/recaptcha/api/verify", - array ( - 'privatekey' => $privkey, - 'remoteip' => $remoteip, - 'challenge' => $challenge, - 'response' => $response - ) + $extra_params - ); - - $answers = explode ("\n", $response [1]); - $recaptcha_response = new ReCaptchaResponse(); - - if (trim ($answers [0]) == 'true') { - $recaptcha_response->is_valid = true; - } - else { - $recaptcha_response->is_valid = false; - $recaptcha_response->error = $answers [1]; - } - return $recaptcha_response; - -} - -/** - * gets a URL where the user can sign up for reCAPTCHA. If your application - * has a configuration page where you enter a key, you should provide a link - * using this function. - * @param string $domain The domain where the page is hosted - * @param string $appname The name of your application - */ -function recaptcha_get_signup_url ($domain = null, $appname = null) { - return "https://www.google.com/recaptcha/admin/create?" . _recaptcha_qsencode (array ('domains' => $domain, 'app' => $appname)); -} - -function _recaptcha_aes_pad($val) { - $block_size = 16; - $numpad = $block_size - (strlen ($val) % $block_size); - return str_pad($val, strlen ($val) + $numpad, chr($numpad)); -} - -/* Mailhide related code */ - -function _recaptcha_aes_encrypt($val,$ky) { - if (! function_exists ("mcrypt_encrypt")) { - die ("To use reCAPTCHA Mailhide, you need to have the mcrypt php module installed."); - } - $mode=MCRYPT_MODE_CBC; - $enc=MCRYPT_RIJNDAEL_128; - $val=_recaptcha_aes_pad($val); - return mcrypt_encrypt($enc, $ky, $val, $mode, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"); -} - - -function _recaptcha_mailhide_urlbase64 ($x) { - return strtr(base64_encode ($x), '+/', '-_'); -} - -/* gets the reCAPTCHA Mailhide url for a given email, public key and private key */ -function recaptcha_mailhide_url($pubkey, $privkey, $email) { - if ($pubkey == '' || $pubkey == null || $privkey == "" || $privkey == null) { - die ("To use reCAPTCHA Mailhide, you have to sign up for a public and private key, " . - "you can do so at http://www.google.com/recaptcha/mailhide/apikey"); - } - - - $ky = pack('H*', $privkey); - $cryptmail = _recaptcha_aes_encrypt ($email, $ky); - - return "http://www.google.com/recaptcha/mailhide/d?k=" . $pubkey . "&c=" . _recaptcha_mailhide_urlbase64 ($cryptmail); -} - -/** - * gets the parts of the email to expose to the user. - * eg, given johndoe@example,com return ["john", "example.com"]. - * the email is then displayed as john...@example.com - */ -function _recaptcha_mailhide_email_parts ($email) { - $arr = preg_split("/@/", $email ); - - if (strlen ($arr[0]) <= 4) { - $arr[0] = substr ($arr[0], 0, 1); - } else if (strlen ($arr[0]) <= 6) { - $arr[0] = substr ($arr[0], 0, 3); - } else { - $arr[0] = substr ($arr[0], 0, 4); - } - return $arr; -} - -/** - * Gets html to display an email address given a public an private key. - * to get a key, go to: - * - * http://www.google.com/recaptcha/mailhide/apikey - */ -function recaptcha_mailhide_html($pubkey, $privkey, $email) { - $emailparts = _recaptcha_mailhide_email_parts ($email); - $url = recaptcha_mailhide_url ($pubkey, $privkey, $email); - - return htmlentities($emailparts[0]) . "...@" . htmlentities ($emailparts [1]); - -} -?> diff --git a/app/vendor/serbanghita/Mobile_Detect.php b/app/vendor/serbanghita/Mobile_Detect.php deleted file mode 100644 index 4e44ff3..0000000 --- a/app/vendor/serbanghita/Mobile_Detect.php +++ /dev/null @@ -1,1459 +0,0 @@ - - * Nick Ilyin - * - * Original author: Victor Stanciu - * - * @license Code and contributions have 'MIT License' - * More details: https://github.com/serbanghita/Mobile-Detect/blob/master/LICENSE.txt - * - * @link Homepage: http://mobiledetect.net - * GitHub Repo: https://github.com/serbanghita/Mobile-Detect - * Google Code: http://code.google.com/p/php-mobile-detect/ - * README: https://github.com/serbanghita/Mobile-Detect/blob/master/README.md - * HOWTO: https://github.com/serbanghita/Mobile-Detect/wiki/Code-examples - * - * @version 2.8.25 - */ - -class Mobile_Detect -{ - /** - * Mobile detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_MOBILE = 'mobile'; - - /** - * Extended detection type. - * - * @deprecated since version 2.6.9 - */ - const DETECTION_TYPE_EXTENDED = 'extended'; - - /** - * A frequently used regular expression to extract version #s. - * - * @deprecated since version 2.6.9 - */ - const VER = '([\w._\+]+)'; - - /** - * Top-level device. - */ - const MOBILE_GRADE_A = 'A'; - - /** - * Mid-level device. - */ - const MOBILE_GRADE_B = 'B'; - - /** - * Low-level device. - */ - const MOBILE_GRADE_C = 'C'; - - /** - * Stores the version number of the current release. - */ - const VERSION = '2.8.25'; - - /** - * A type for the version() method indicating a string return value. - */ - const VERSION_TYPE_STRING = 'text'; - - /** - * A type for the version() method indicating a float return value. - */ - const VERSION_TYPE_FLOAT = 'float'; - - /** - * A cache for resolved matches - * @var array - */ - protected $cache = array(); - - /** - * The User-Agent HTTP header is stored in here. - * @var string - */ - protected $userAgent = null; - - /** - * HTTP headers in the PHP-flavor. So HTTP_USER_AGENT and SERVER_SOFTWARE. - * @var array - */ - protected $httpHeaders = array(); - - /** - * CloudFront headers. E.g. CloudFront-Is-Desktop-Viewer, CloudFront-Is-Mobile-Viewer & CloudFront-Is-Tablet-Viewer. - * @var array - */ - protected $cloudfrontHeaders = array(); - - /** - * The matching Regex. - * This is good for debug. - * @var string - */ - protected $matchingRegex = null; - - /** - * The matches extracted from the regex expression. - * This is good for debug. - * @var string - */ - protected $matchesArray = null; - - /** - * The detection type, using self::DETECTION_TYPE_MOBILE or self::DETECTION_TYPE_EXTENDED. - * - * @deprecated since version 2.6.9 - * - * @var string - */ - protected $detectionType = self::DETECTION_TYPE_MOBILE; - - /** - * HTTP headers that trigger the 'isMobile' detection - * to be true. - * - * @var array - */ - protected static $mobileHeaders = array( - - 'HTTP_ACCEPT' => array('matches' => array( - // Opera Mini; @reference: http://dev.opera.com/articles/view/opera-binary-markup-language/ - 'application/x-obml2d', - // BlackBerry devices. - 'application/vnd.rim.html', - 'text/vnd.wap.wml', - 'application/vnd.wap.xhtml+xml' - )), - 'HTTP_X_WAP_PROFILE' => null, - 'HTTP_X_WAP_CLIENTID' => null, - 'HTTP_WAP_CONNECTION' => null, - 'HTTP_PROFILE' => null, - // Reported by Opera on Nokia devices (eg. C3). - 'HTTP_X_OPERAMINI_PHONE_UA' => null, - 'HTTP_X_NOKIA_GATEWAY_ID' => null, - 'HTTP_X_ORANGE_ID' => null, - 'HTTP_X_VODAFONE_3GPDPCONTEXT' => null, - 'HTTP_X_HUAWEI_USERID' => null, - // Reported by Windows Smartphones. - 'HTTP_UA_OS' => null, - // Reported by Verizon, Vodafone proxy system. - 'HTTP_X_MOBILE_GATEWAY' => null, - // Seen this on HTC Sensation. SensationXE_Beats_Z715e. - 'HTTP_X_ATT_DEVICEID' => null, - // Seen this on a HTC. - 'HTTP_UA_CPU' => array('matches' => array('ARM')), - ); - - /** - * List of mobile devices (phones). - * - * @var array - */ - protected static $phoneDevices = array( - 'iPhone' => '\biPhone\b|\biPod\b', // |\biTunes - 'BlackBerry' => 'BlackBerry|\bBB10\b|rim[0-9]+', - 'HTC' => 'HTC|HTC.*(Sensation|Evo|Vision|Explorer|6800|8100|8900|A7272|S510e|C110e|Legend|Desire|T8282)|APX515CKT|Qtek9090|APA9292KT|HD_mini|Sensation.*Z710e|PG86100|Z715e|Desire.*(A8181|HD)|ADR6200|ADR6400L|ADR6425|001HT|Inspire 4G|Android.*\bEVO\b|T-Mobile G1|Z520m', - 'Nexus' => 'Nexus One|Nexus S|Galaxy.*Nexus|Android.*Nexus.*Mobile|Nexus 4|Nexus 5|Nexus 6', - // @todo: Is 'Dell Streak' a tablet or a phone? ;) - 'Dell' => 'Dell.*Streak|Dell.*Aero|Dell.*Venue|DELL.*Venue Pro|Dell Flash|Dell Smoke|Dell Mini 3iX|XCD28|XCD35|\b001DL\b|\b101DL\b|\bGS01\b', - 'Motorola' => 'Motorola|DROIDX|DROID BIONIC|\bDroid\b.*Build|Android.*Xoom|HRI39|MOT-|A1260|A1680|A555|A853|A855|A953|A955|A956|Motorola.*ELECTRIFY|Motorola.*i1|i867|i940|MB200|MB300|MB501|MB502|MB508|MB511|MB520|MB525|MB526|MB611|MB612|MB632|MB810|MB855|MB860|MB861|MB865|MB870|ME501|ME502|ME511|ME525|ME600|ME632|ME722|ME811|ME860|ME863|ME865|MT620|MT710|MT716|MT720|MT810|MT870|MT917|Motorola.*TITANIUM|WX435|WX445|XT300|XT301|XT311|XT316|XT317|XT319|XT320|XT390|XT502|XT530|XT531|XT532|XT535|XT603|XT610|XT611|XT615|XT681|XT701|XT702|XT711|XT720|XT800|XT806|XT860|XT862|XT875|XT882|XT883|XT894|XT901|XT907|XT909|XT910|XT912|XT928|XT926|XT915|XT919|XT925|XT1021|\bMoto E\b', - 'Samsung' => '\bSamsung\b|SM-G9250|GT-19300|SGH-I337|BGT-S5230|GT-B2100|GT-B2700|GT-B2710|GT-B3210|GT-B3310|GT-B3410|GT-B3730|GT-B3740|GT-B5510|GT-B5512|GT-B5722|GT-B6520|GT-B7300|GT-B7320|GT-B7330|GT-B7350|GT-B7510|GT-B7722|GT-B7800|GT-C3010|GT-C3011|GT-C3060|GT-C3200|GT-C3212|GT-C3212I|GT-C3262|GT-C3222|GT-C3300|GT-C3300K|GT-C3303|GT-C3303K|GT-C3310|GT-C3322|GT-C3330|GT-C3350|GT-C3500|GT-C3510|GT-C3530|GT-C3630|GT-C3780|GT-C5010|GT-C5212|GT-C6620|GT-C6625|GT-C6712|GT-E1050|GT-E1070|GT-E1075|GT-E1080|GT-E1081|GT-E1085|GT-E1087|GT-E1100|GT-E1107|GT-E1110|GT-E1120|GT-E1125|GT-E1130|GT-E1160|GT-E1170|GT-E1175|GT-E1180|GT-E1182|GT-E1200|GT-E1210|GT-E1225|GT-E1230|GT-E1390|GT-E2100|GT-E2120|GT-E2121|GT-E2152|GT-E2220|GT-E2222|GT-E2230|GT-E2232|GT-E2250|GT-E2370|GT-E2550|GT-E2652|GT-E3210|GT-E3213|GT-I5500|GT-I5503|GT-I5700|GT-I5800|GT-I5801|GT-I6410|GT-I6420|GT-I7110|GT-I7410|GT-I7500|GT-I8000|GT-I8150|GT-I8160|GT-I8190|GT-I8320|GT-I8330|GT-I8350|GT-I8530|GT-I8700|GT-I8703|GT-I8910|GT-I9000|GT-I9001|GT-I9003|GT-I9010|GT-I9020|GT-I9023|GT-I9070|GT-I9082|GT-I9100|GT-I9103|GT-I9220|GT-I9250|GT-I9300|GT-I9305|GT-I9500|GT-I9505|GT-M3510|GT-M5650|GT-M7500|GT-M7600|GT-M7603|GT-M8800|GT-M8910|GT-N7000|GT-S3110|GT-S3310|GT-S3350|GT-S3353|GT-S3370|GT-S3650|GT-S3653|GT-S3770|GT-S3850|GT-S5210|GT-S5220|GT-S5229|GT-S5230|GT-S5233|GT-S5250|GT-S5253|GT-S5260|GT-S5263|GT-S5270|GT-S5300|GT-S5330|GT-S5350|GT-S5360|GT-S5363|GT-S5369|GT-S5380|GT-S5380D|GT-S5560|GT-S5570|GT-S5600|GT-S5603|GT-S5610|GT-S5620|GT-S5660|GT-S5670|GT-S5690|GT-S5750|GT-S5780|GT-S5830|GT-S5839|GT-S6102|GT-S6500|GT-S7070|GT-S7200|GT-S7220|GT-S7230|GT-S7233|GT-S7250|GT-S7500|GT-S7530|GT-S7550|GT-S7562|GT-S7710|GT-S8000|GT-S8003|GT-S8500|GT-S8530|GT-S8600|SCH-A310|SCH-A530|SCH-A570|SCH-A610|SCH-A630|SCH-A650|SCH-A790|SCH-A795|SCH-A850|SCH-A870|SCH-A890|SCH-A930|SCH-A950|SCH-A970|SCH-A990|SCH-I100|SCH-I110|SCH-I400|SCH-I405|SCH-I500|SCH-I510|SCH-I515|SCH-I600|SCH-I730|SCH-I760|SCH-I770|SCH-I830|SCH-I910|SCH-I920|SCH-I959|SCH-LC11|SCH-N150|SCH-N300|SCH-R100|SCH-R300|SCH-R351|SCH-R400|SCH-R410|SCH-T300|SCH-U310|SCH-U320|SCH-U350|SCH-U360|SCH-U365|SCH-U370|SCH-U380|SCH-U410|SCH-U430|SCH-U450|SCH-U460|SCH-U470|SCH-U490|SCH-U540|SCH-U550|SCH-U620|SCH-U640|SCH-U650|SCH-U660|SCH-U700|SCH-U740|SCH-U750|SCH-U810|SCH-U820|SCH-U900|SCH-U940|SCH-U960|SCS-26UC|SGH-A107|SGH-A117|SGH-A127|SGH-A137|SGH-A157|SGH-A167|SGH-A177|SGH-A187|SGH-A197|SGH-A227|SGH-A237|SGH-A257|SGH-A437|SGH-A517|SGH-A597|SGH-A637|SGH-A657|SGH-A667|SGH-A687|SGH-A697|SGH-A707|SGH-A717|SGH-A727|SGH-A737|SGH-A747|SGH-A767|SGH-A777|SGH-A797|SGH-A817|SGH-A827|SGH-A837|SGH-A847|SGH-A867|SGH-A877|SGH-A887|SGH-A897|SGH-A927|SGH-B100|SGH-B130|SGH-B200|SGH-B220|SGH-C100|SGH-C110|SGH-C120|SGH-C130|SGH-C140|SGH-C160|SGH-C170|SGH-C180|SGH-C200|SGH-C207|SGH-C210|SGH-C225|SGH-C230|SGH-C417|SGH-C450|SGH-D307|SGH-D347|SGH-D357|SGH-D407|SGH-D415|SGH-D780|SGH-D807|SGH-D980|SGH-E105|SGH-E200|SGH-E315|SGH-E316|SGH-E317|SGH-E335|SGH-E590|SGH-E635|SGH-E715|SGH-E890|SGH-F300|SGH-F480|SGH-I200|SGH-I300|SGH-I320|SGH-I550|SGH-I577|SGH-I600|SGH-I607|SGH-I617|SGH-I627|SGH-I637|SGH-I677|SGH-I700|SGH-I717|SGH-I727|SGH-i747M|SGH-I777|SGH-I780|SGH-I827|SGH-I847|SGH-I857|SGH-I896|SGH-I897|SGH-I900|SGH-I907|SGH-I917|SGH-I927|SGH-I937|SGH-I997|SGH-J150|SGH-J200|SGH-L170|SGH-L700|SGH-M110|SGH-M150|SGH-M200|SGH-N105|SGH-N500|SGH-N600|SGH-N620|SGH-N625|SGH-N700|SGH-N710|SGH-P107|SGH-P207|SGH-P300|SGH-P310|SGH-P520|SGH-P735|SGH-P777|SGH-Q105|SGH-R210|SGH-R220|SGH-R225|SGH-S105|SGH-S307|SGH-T109|SGH-T119|SGH-T139|SGH-T209|SGH-T219|SGH-T229|SGH-T239|SGH-T249|SGH-T259|SGH-T309|SGH-T319|SGH-T329|SGH-T339|SGH-T349|SGH-T359|SGH-T369|SGH-T379|SGH-T409|SGH-T429|SGH-T439|SGH-T459|SGH-T469|SGH-T479|SGH-T499|SGH-T509|SGH-T519|SGH-T539|SGH-T559|SGH-T589|SGH-T609|SGH-T619|SGH-T629|SGH-T639|SGH-T659|SGH-T669|SGH-T679|SGH-T709|SGH-T719|SGH-T729|SGH-T739|SGH-T746|SGH-T749|SGH-T759|SGH-T769|SGH-T809|SGH-T819|SGH-T839|SGH-T919|SGH-T929|SGH-T939|SGH-T959|SGH-T989|SGH-U100|SGH-U200|SGH-U800|SGH-V205|SGH-V206|SGH-X100|SGH-X105|SGH-X120|SGH-X140|SGH-X426|SGH-X427|SGH-X475|SGH-X495|SGH-X497|SGH-X507|SGH-X600|SGH-X610|SGH-X620|SGH-X630|SGH-X700|SGH-X820|SGH-X890|SGH-Z130|SGH-Z150|SGH-Z170|SGH-ZX10|SGH-ZX20|SHW-M110|SPH-A120|SPH-A400|SPH-A420|SPH-A460|SPH-A500|SPH-A560|SPH-A600|SPH-A620|SPH-A660|SPH-A700|SPH-A740|SPH-A760|SPH-A790|SPH-A800|SPH-A820|SPH-A840|SPH-A880|SPH-A900|SPH-A940|SPH-A960|SPH-D600|SPH-D700|SPH-D710|SPH-D720|SPH-I300|SPH-I325|SPH-I330|SPH-I350|SPH-I500|SPH-I600|SPH-I700|SPH-L700|SPH-M100|SPH-M220|SPH-M240|SPH-M300|SPH-M305|SPH-M320|SPH-M330|SPH-M350|SPH-M360|SPH-M370|SPH-M380|SPH-M510|SPH-M540|SPH-M550|SPH-M560|SPH-M570|SPH-M580|SPH-M610|SPH-M620|SPH-M630|SPH-M800|SPH-M810|SPH-M850|SPH-M900|SPH-M910|SPH-M920|SPH-M930|SPH-N100|SPH-N200|SPH-N240|SPH-N300|SPH-N400|SPH-Z400|SWC-E100|SCH-i909|GT-N7100|GT-N7105|SCH-I535|SM-N900A|SGH-I317|SGH-T999L|GT-S5360B|GT-I8262|GT-S6802|GT-S6312|GT-S6310|GT-S5312|GT-S5310|GT-I9105|GT-I8510|GT-S6790N|SM-G7105|SM-N9005|GT-S5301|GT-I9295|GT-I9195|SM-C101|GT-S7392|GT-S7560|GT-B7610|GT-I5510|GT-S7582|GT-S7530E|GT-I8750|SM-G9006V|SM-G9008V|SM-G9009D|SM-G900A|SM-G900D|SM-G900F|SM-G900H|SM-G900I|SM-G900J|SM-G900K|SM-G900L|SM-G900M|SM-G900P|SM-G900R4|SM-G900S|SM-G900T|SM-G900V|SM-G900W8|SHV-E160K|SCH-P709|SCH-P729|SM-T2558|GT-I9205|SM-G9350|SM-J120F|SM-G920F|SM-G920V|SM-G930F|SM-N910C', - 'LG' => '\bLG\b;|LG[- ]?(C800|C900|E400|E610|E900|E-900|F160|F180K|F180L|F180S|730|855|L160|LS740|LS840|LS970|LU6200|MS690|MS695|MS770|MS840|MS870|MS910|P500|P700|P705|VM696|AS680|AS695|AX840|C729|E970|GS505|272|C395|E739BK|E960|L55C|L75C|LS696|LS860|P769BK|P350|P500|P509|P870|UN272|US730|VS840|VS950|LN272|LN510|LS670|LS855|LW690|MN270|MN510|P509|P769|P930|UN200|UN270|UN510|UN610|US670|US740|US760|UX265|UX840|VN271|VN530|VS660|VS700|VS740|VS750|VS910|VS920|VS930|VX9200|VX11000|AX840A|LW770|P506|P925|P999|E612|D955|D802|MS323)', - 'Sony' => 'SonyST|SonyLT|SonyEricsson|SonyEricssonLT15iv|LT18i|E10i|LT28h|LT26w|SonyEricssonMT27i|C5303|C6902|C6903|C6906|C6943|D2533', - 'Asus' => 'Asus.*Galaxy|PadFone.*Mobile', - 'NokiaLumia' => 'Lumia [0-9]{3,4}', - // http://www.micromaxinfo.com/mobiles/smartphones - // Added because the codes might conflict with Acer Tablets. - 'Micromax' => 'Micromax.*\b(A210|A92|A88|A72|A111|A110Q|A115|A116|A110|A90S|A26|A51|A35|A54|A25|A27|A89|A68|A65|A57|A90)\b', - // @todo Complete the regex. - 'Palm' => 'PalmSource|Palm', // avantgo|blazer|elaine|hiptop|plucker|xiino ; - 'Vertu' => 'Vertu|Vertu.*Ltd|Vertu.*Ascent|Vertu.*Ayxta|Vertu.*Constellation(F|Quest)?|Vertu.*Monika|Vertu.*Signature', // Just for fun ;) - // http://www.pantech.co.kr/en/prod/prodList.do?gbrand=VEGA (PANTECH) - // Most of the VEGA devices are legacy. PANTECH seem to be newer devices based on Android. - 'Pantech' => 'PANTECH|IM-A850S|IM-A840S|IM-A830L|IM-A830K|IM-A830S|IM-A820L|IM-A810K|IM-A810S|IM-A800S|IM-T100K|IM-A725L|IM-A780L|IM-A775C|IM-A770K|IM-A760S|IM-A750K|IM-A740S|IM-A730S|IM-A720L|IM-A710K|IM-A690L|IM-A690S|IM-A650S|IM-A630K|IM-A600S|VEGA PTL21|PT003|P8010|ADR910L|P6030|P6020|P9070|P4100|P9060|P5000|CDM8992|TXT8045|ADR8995|IS11PT|P2030|P6010|P8000|PT002|IS06|CDM8999|P9050|PT001|TXT8040|P2020|P9020|P2000|P7040|P7000|C790', - // http://www.fly-phone.com/devices/smartphones/ ; Included only smartphones. - 'Fly' => 'IQ230|IQ444|IQ450|IQ440|IQ442|IQ441|IQ245|IQ256|IQ236|IQ255|IQ235|IQ245|IQ275|IQ240|IQ285|IQ280|IQ270|IQ260|IQ250', - // http://fr.wikomobile.com - 'Wiko' => 'KITE 4G|HIGHWAY|GETAWAY|STAIRWAY|DARKSIDE|DARKFULL|DARKNIGHT|DARKMOON|SLIDE|WAX 4G|RAINBOW|BLOOM|SUNSET|GOA(?!nna)|LENNY|BARRY|IGGY|OZZY|CINK FIVE|CINK PEAX|CINK PEAX 2|CINK SLIM|CINK SLIM 2|CINK +|CINK KING|CINK PEAX|CINK SLIM|SUBLIM', - 'iMobile' => 'i-mobile (IQ|i-STYLE|idea|ZAA|Hitz)', - // Added simvalley mobile just for fun. They have some interesting devices. - // http://www.simvalley.fr/telephonie---gps-_22_telephonie-mobile_telephones_.html - 'SimValley' => '\b(SP-80|XT-930|SX-340|XT-930|SX-310|SP-360|SP60|SPT-800|SP-120|SPT-800|SP-140|SPX-5|SPX-8|SP-100|SPX-8|SPX-12)\b', - // Wolfgang - a brand that is sold by Aldi supermarkets. - // http://www.wolfgangmobile.com/ - 'Wolfgang' => 'AT-B24D|AT-AS50HD|AT-AS40W|AT-AS55HD|AT-AS45q2|AT-B26D|AT-AS50Q', - 'Alcatel' => 'Alcatel', - 'Nintendo' => 'Nintendo 3DS', - // http://en.wikipedia.org/wiki/Amoi - 'Amoi' => 'Amoi', - // http://en.wikipedia.org/wiki/INQ - 'INQ' => 'INQ', - // @Tapatalk is a mobile app; http://support.tapatalk.com/threads/smf-2-0-2-os-and-browser-detection-plugin-and-tapatalk.15565/#post-79039 - 'GenericPhone' => 'Tapatalk|PDA;|SAGEM|\bmmp\b|pocket|\bpsp\b|symbian|Smartphone|smartfon|treo|up.browser|up.link|vodafone|\bwap\b|nokia|Series40|Series60|S60|SonyEricsson|N900|MAUI.*WAP.*Browser', - ); - - /** - * List of tablet devices. - * - * @var array - */ - protected static $tabletDevices = array( - // @todo: check for mobile friendly emails topic. - 'iPad' => 'iPad|iPad.*Mobile', - // Removed |^.*Android.*Nexus(?!(?:Mobile).)*$ - // @see #442 - 'NexusTablet' => 'Android.*Nexus[\s]+(7|9|10)', - 'SamsungTablet' => 'SAMSUNG.*Tablet|Galaxy.*Tab|SC-01C|GT-P1000|GT-P1003|GT-P1010|GT-P3105|GT-P6210|GT-P6800|GT-P6810|GT-P7100|GT-P7300|GT-P7310|GT-P7500|GT-P7510|SCH-I800|SCH-I815|SCH-I905|SGH-I957|SGH-I987|SGH-T849|SGH-T859|SGH-T869|SPH-P100|GT-P3100|GT-P3108|GT-P3110|GT-P5100|GT-P5110|GT-P6200|GT-P7320|GT-P7511|GT-N8000|GT-P8510|SGH-I497|SPH-P500|SGH-T779|SCH-I705|SCH-I915|GT-N8013|GT-P3113|GT-P5113|GT-P8110|GT-N8010|GT-N8005|GT-N8020|GT-P1013|GT-P6201|GT-P7501|GT-N5100|GT-N5105|GT-N5110|SHV-E140K|SHV-E140L|SHV-E140S|SHV-E150S|SHV-E230K|SHV-E230L|SHV-E230S|SHW-M180K|SHW-M180L|SHW-M180S|SHW-M180W|SHW-M300W|SHW-M305W|SHW-M380K|SHW-M380S|SHW-M380W|SHW-M430W|SHW-M480K|SHW-M480S|SHW-M480W|SHW-M485W|SHW-M486W|SHW-M500W|GT-I9228|SCH-P739|SCH-I925|GT-I9200|GT-P5200|GT-P5210|GT-P5210X|SM-T311|SM-T310|SM-T310X|SM-T210|SM-T210R|SM-T211|SM-P600|SM-P601|SM-P605|SM-P900|SM-P901|SM-T217|SM-T217A|SM-T217S|SM-P6000|SM-T3100|SGH-I467|XE500|SM-T110|GT-P5220|GT-I9200X|GT-N5110X|GT-N5120|SM-P905|SM-T111|SM-T2105|SM-T315|SM-T320|SM-T320X|SM-T321|SM-T520|SM-T525|SM-T530NU|SM-T230NU|SM-T330NU|SM-T900|XE500T1C|SM-P605V|SM-P905V|SM-T337V|SM-T537V|SM-T707V|SM-T807V|SM-P600X|SM-P900X|SM-T210X|SM-T230|SM-T230X|SM-T325|GT-P7503|SM-T531|SM-T330|SM-T530|SM-T705|SM-T705C|SM-T535|SM-T331|SM-T800|SM-T700|SM-T537|SM-T807|SM-P907A|SM-T337A|SM-T537A|SM-T707A|SM-T807A|SM-T237|SM-T807P|SM-P607T|SM-T217T|SM-T337T|SM-T807T|SM-T116NQ|SM-P550|SM-T350|SM-T550|SM-T9000|SM-P9000|SM-T705Y|SM-T805|GT-P3113|SM-T710|SM-T810|SM-T815|SM-T360|SM-T533|SM-T113|SM-T335|SM-T715|SM-T560|SM-T670|SM-T677|SM-T377|SM-T567|SM-T357T|SM-T555|SM-T561|SM-T713|SM-T719|SM-T813|SM-T819|SM-T580|SM-T355Y|SM-T280|SM-T817A|SM-T820|SM-W700|SM-P580|SM-T587', // SCH-P709|SCH-P729|SM-T2558|GT-I9205 - Samsung Mega - treat them like a regular phone. - // http://docs.aws.amazon.com/silk/latest/developerguide/user-agent.html - 'Kindle' => 'Kindle|Silk.*Accelerated|Android.*\b(KFOT|KFTT|KFJWI|KFJWA|KFOTE|KFSOWI|KFTHWI|KFTHWA|KFAPWI|KFAPWA|WFJWAE|KFSAWA|KFSAWI|KFASWI|KFARWI|KFFOWI|KFGIWI|KFMEWI)\b|Android.*Silk/[0-9.]+ like Chrome/[0-9.]+ (?!Mobile)', - // Only the Surface tablets with Windows RT are considered mobile. - // http://msdn.microsoft.com/en-us/library/ie/hh920767(v=vs.85).aspx - 'SurfaceTablet' => 'Windows NT [0-9.]+; ARM;.*(Tablet|ARMBJS)', - // http://shopping1.hp.com/is-bin/INTERSHOP.enfinity/WFS/WW-USSMBPublicStore-Site/en_US/-/USD/ViewStandardCatalog-Browse?CatalogCategoryID=JfIQ7EN5lqMAAAEyDcJUDwMT - 'HPTablet' => 'HP Slate (7|8|10)|HP ElitePad 900|hp-tablet|EliteBook.*Touch|HP 8|Slate 21|HP SlateBook 10', - // Watch out for PadFone, see #132. - // http://www.asus.com/de/Tablets_Mobile/Memo_Pad_Products/ - 'AsusTablet' => '^.*PadFone((?!Mobile).)*$|Transformer|TF101|TF101G|TF300T|TF300TG|TF300TL|TF700T|TF700KL|TF701T|TF810C|ME171|ME301T|ME302C|ME371MG|ME370T|ME372MG|ME172V|ME173X|ME400C|Slider SL101|\bK00F\b|\bK00C\b|\bK00E\b|\bK00L\b|TX201LA|ME176C|ME102A|\bM80TA\b|ME372CL|ME560CG|ME372CG|ME302KL| K010 | K011 | K017 | K01E |ME572C|ME103K|ME170C|ME171C|\bME70C\b|ME581C|ME581CL|ME8510C|ME181C|P01Y|PO1MA|P01Z', - 'BlackBerryTablet' => 'PlayBook|RIM Tablet', - 'HTCtablet' => 'HTC_Flyer_P512|HTC Flyer|HTC Jetstream|HTC-P715a|HTC EVO View 4G|PG41200|PG09410', - 'MotorolaTablet' => 'xoom|sholest|MZ615|MZ605|MZ505|MZ601|MZ602|MZ603|MZ604|MZ606|MZ607|MZ608|MZ609|MZ615|MZ616|MZ617', - 'NookTablet' => 'Android.*Nook|NookColor|nook browser|BNRV200|BNRV200A|BNTV250|BNTV250A|BNTV400|BNTV600|LogicPD Zoom2', - // http://www.acer.ro/ac/ro/RO/content/drivers - // http://www.packardbell.co.uk/pb/en/GB/content/download (Packard Bell is part of Acer) - // http://us.acer.com/ac/en/US/content/group/tablets - // http://www.acer.de/ac/de/DE/content/models/tablets/ - // Can conflict with Micromax and Motorola phones codes. - 'AcerTablet' => 'Android.*; \b(A100|A101|A110|A200|A210|A211|A500|A501|A510|A511|A700|A701|W500|W500P|W501|W501P|W510|W511|W700|G100|G100W|B1-A71|B1-710|B1-711|A1-810|A1-811|A1-830)\b|W3-810|\bA3-A10\b|\bA3-A11\b|\bA3-A20\b|\bA3-A30', - // http://eu.computers.toshiba-europe.com/innovation/family/Tablets/1098744/banner_id/tablet_footerlink/ - // http://us.toshiba.com/tablets/tablet-finder - // http://www.toshiba.co.jp/regza/tablet/ - 'ToshibaTablet' => 'Android.*(AT100|AT105|AT200|AT205|AT270|AT275|AT300|AT305|AT1S5|AT500|AT570|AT700|AT830)|TOSHIBA.*FOLIO', - // http://www.nttdocomo.co.jp/english/service/developer/smart_phone/technical_info/spec/index.html - // http://www.lg.com/us/tablets - 'LGTablet' => '\bL-06C|LG-V909|LG-V900|LG-V700|LG-V510|LG-V500|LG-V410|LG-V400|LG-VK810\b', - 'FujitsuTablet' => 'Android.*\b(F-01D|F-02F|F-05E|F-10D|M532|Q572)\b', - // Prestigio Tablets http://www.prestigio.com/support - 'PrestigioTablet' => 'PMP3170B|PMP3270B|PMP3470B|PMP7170B|PMP3370B|PMP3570C|PMP5870C|PMP3670B|PMP5570C|PMP5770D|PMP3970B|PMP3870C|PMP5580C|PMP5880D|PMP5780D|PMP5588C|PMP7280C|PMP7280C3G|PMP7280|PMP7880D|PMP5597D|PMP5597|PMP7100D|PER3464|PER3274|PER3574|PER3884|PER5274|PER5474|PMP5097CPRO|PMP5097|PMP7380D|PMP5297C|PMP5297C_QUAD|PMP812E|PMP812E3G|PMP812F|PMP810E|PMP880TD|PMT3017|PMT3037|PMT3047|PMT3057|PMT7008|PMT5887|PMT5001|PMT5002', - // http://support.lenovo.com/en_GB/downloads/default.page?# - 'LenovoTablet' => 'Lenovo TAB|Idea(Tab|Pad)( A1|A10| K1|)|ThinkPad([ ]+)?Tablet|YT3-X90L|YT3-X90F|YT3-X90X|Lenovo.*(S2109|S2110|S5000|S6000|K3011|A3000|A3500|A1000|A2107|A2109|A1107|A5500|A7600|B6000|B8000|B8080)(-|)(FL|F|HV|H|)', - // http://www.dell.com/support/home/us/en/04/Products/tab_mob/tablets - 'DellTablet' => 'Venue 11|Venue 8|Venue 7|Dell Streak 10|Dell Streak 7', - // http://www.yarvik.com/en/matrix/tablets/ - 'YarvikTablet' => 'Android.*\b(TAB210|TAB211|TAB224|TAB250|TAB260|TAB264|TAB310|TAB360|TAB364|TAB410|TAB411|TAB420|TAB424|TAB450|TAB460|TAB461|TAB464|TAB465|TAB467|TAB468|TAB07-100|TAB07-101|TAB07-150|TAB07-151|TAB07-152|TAB07-200|TAB07-201-3G|TAB07-210|TAB07-211|TAB07-212|TAB07-214|TAB07-220|TAB07-400|TAB07-485|TAB08-150|TAB08-200|TAB08-201-3G|TAB08-201-30|TAB09-100|TAB09-211|TAB09-410|TAB10-150|TAB10-201|TAB10-211|TAB10-400|TAB10-410|TAB13-201|TAB274EUK|TAB275EUK|TAB374EUK|TAB462EUK|TAB474EUK|TAB9-200)\b', - 'MedionTablet' => 'Android.*\bOYO\b|LIFE.*(P9212|P9514|P9516|S9512)|LIFETAB', - 'ArnovaTablet' => '97G4|AN10G2|AN7bG3|AN7fG3|AN8G3|AN8cG3|AN7G3|AN9G3|AN7dG3|AN7dG3ST|AN7dG3ChildPad|AN10bG3|AN10bG3DT|AN9G2', - // http://www.intenso.de/kategorie_en.php?kategorie=33 - // @todo: http://www.nbhkdz.com/read/b8e64202f92a2df129126bff.html - investigate - 'IntensoTablet' => 'INM8002KP|INM1010FP|INM805ND|Intenso Tab|TAB1004', - // IRU.ru Tablets http://www.iru.ru/catalog/soho/planetable/ - 'IRUTablet' => 'M702pro', - 'MegafonTablet' => 'MegaFon V9|\bZTE V9\b|Android.*\bMT7A\b', - // http://www.e-boda.ro/tablete-pc.html - 'EbodaTablet' => 'E-Boda (Supreme|Impresspeed|Izzycomm|Essential)', - // http://www.allview.ro/produse/droseries/lista-tablete-pc/ - 'AllViewTablet' => 'Allview.*(Viva|Alldro|City|Speed|All TV|Frenzy|Quasar|Shine|TX1|AX1|AX2)', - // http://wiki.archosfans.com/index.php?title=Main_Page - // @note Rewrite the regex format after we add more UAs. - 'ArchosTablet' => '\b(101G9|80G9|A101IT)\b|Qilive 97R|Archos5|\bARCHOS (70|79|80|90|97|101|FAMILYPAD|)(b|c|)(G10| Cobalt| TITANIUM(HD|)| Xenon| Neon|XSK| 2| XS 2| PLATINUM| CARBON|GAMEPAD)\b', - // http://www.ainol.com/plugin.php?identifier=ainol&module=product - 'AinolTablet' => 'NOVO7|NOVO8|NOVO10|Novo7Aurora|Novo7Basic|NOVO7PALADIN|novo9-Spark', - 'NokiaLumiaTablet' => 'Lumia 2520', - // @todo: inspect http://esupport.sony.com/US/p/select-system.pl?DIRECTOR=DRIVER - // Readers http://www.atsuhiro-me.net/ebook/sony-reader/sony-reader-web-browser - // http://www.sony.jp/support/tablet/ - 'SonyTablet' => 'Sony.*Tablet|Xperia Tablet|Sony Tablet S|SO-03E|SGPT12|SGPT13|SGPT114|SGPT121|SGPT122|SGPT123|SGPT111|SGPT112|SGPT113|SGPT131|SGPT132|SGPT133|SGPT211|SGPT212|SGPT213|SGP311|SGP312|SGP321|EBRD1101|EBRD1102|EBRD1201|SGP351|SGP341|SGP511|SGP512|SGP521|SGP541|SGP551|SGP621|SGP612|SOT31', - // http://www.support.philips.com/support/catalog/worldproducts.jsp?userLanguage=en&userCountry=cn&categoryid=3G_LTE_TABLET_SU_CN_CARE&title=3G%20tablets%20/%20LTE%20range&_dyncharset=UTF-8 - 'PhilipsTablet' => '\b(PI2010|PI3000|PI3100|PI3105|PI3110|PI3205|PI3210|PI3900|PI4010|PI7000|PI7100)\b', - // db + http://www.cube-tablet.com/buy-products.html - 'CubeTablet' => 'Android.*(K8GT|U9GT|U10GT|U16GT|U17GT|U18GT|U19GT|U20GT|U23GT|U30GT)|CUBE U8GT', - // http://www.cobyusa.com/?p=pcat&pcat_id=3001 - 'CobyTablet' => 'MID1042|MID1045|MID1125|MID1126|MID7012|MID7014|MID7015|MID7034|MID7035|MID7036|MID7042|MID7048|MID7127|MID8042|MID8048|MID8127|MID9042|MID9740|MID9742|MID7022|MID7010', - // http://www.match.net.cn/products.asp - 'MIDTablet' => 'M9701|M9000|M9100|M806|M1052|M806|T703|MID701|MID713|MID710|MID727|MID760|MID830|MID728|MID933|MID125|MID810|MID732|MID120|MID930|MID800|MID731|MID900|MID100|MID820|MID735|MID980|MID130|MID833|MID737|MID960|MID135|MID860|MID736|MID140|MID930|MID835|MID733|MID4X10', - // http://www.msi.com/support - // @todo Research the Windows Tablets. - 'MSITablet' => 'MSI \b(Primo 73K|Primo 73L|Primo 81L|Primo 77|Primo 93|Primo 75|Primo 76|Primo 73|Primo 81|Primo 91|Primo 90|Enjoy 71|Enjoy 7|Enjoy 10)\b', - // @todo http://www.kyoceramobile.com/support/drivers/ - // 'KyoceraTablet' => null, - // @todo http://intexuae.com/index.php/category/mobile-devices/tablets-products/ - // 'IntextTablet' => null, - // http://pdadb.net/index.php?m=pdalist&list=SMiT (NoName Chinese Tablets) - // http://www.imp3.net/14/show.php?itemid=20454 - 'SMiTTablet' => 'Android.*(\bMID\b|MID-560|MTV-T1200|MTV-PND531|MTV-P1101|MTV-PND530)', - // http://www.rock-chips.com/index.php?do=prod&pid=2 - 'RockChipTablet' => 'Android.*(RK2818|RK2808A|RK2918|RK3066)|RK2738|RK2808A', - // http://www.fly-phone.com/devices/tablets/ ; http://www.fly-phone.com/service/ - 'FlyTablet' => 'IQ310|Fly Vision', - // http://www.bqreaders.com/gb/tablets-prices-sale.html - 'bqTablet' => 'Android.*(bq)?.*(Elcano|Curie|Edison|Maxwell|Kepler|Pascal|Tesla|Hypatia|Platon|Newton|Livingstone|Cervantes|Avant|Aquaris [E|M]10)|Maxwell.*Lite|Maxwell.*Plus', - // http://www.huaweidevice.com/worldwide/productFamily.do?method=index&directoryId=5011&treeId=3290 - // http://www.huaweidevice.com/worldwide/downloadCenter.do?method=index&directoryId=3372&treeId=0&tb=1&type=software (including legacy tablets) - 'HuaweiTablet' => 'MediaPad|MediaPad 7 Youth|IDEOS S7|S7-201c|S7-202u|S7-101|S7-103|S7-104|S7-105|S7-106|S7-201|S7-Slim', - // Nec or Medias Tab - 'NecTablet' => '\bN-06D|\bN-08D', - // Pantech Tablets: http://www.pantechusa.com/phones/ - 'PantechTablet' => 'Pantech.*P4100', - // Broncho Tablets: http://www.broncho.cn/ (hard to find) - 'BronchoTablet' => 'Broncho.*(N701|N708|N802|a710)', - // http://versusuk.com/support.html - 'VersusTablet' => 'TOUCHPAD.*[78910]|\bTOUCHTAB\b', - // http://www.zync.in/index.php/our-products/tablet-phablets - 'ZyncTablet' => 'z1000|Z99 2G|z99|z930|z999|z990|z909|Z919|z900', - // http://www.positivoinformatica.com.br/www/pessoal/tablet-ypy/ - 'PositivoTablet' => 'TB07STA|TB10STA|TB07FTA|TB10FTA', - // https://www.nabitablet.com/ - 'NabiTablet' => 'Android.*\bNabi', - 'KoboTablet' => 'Kobo Touch|\bK080\b|\bVox\b Build|\bArc\b Build', - // French Danew Tablets http://www.danew.com/produits-tablette.php - 'DanewTablet' => 'DSlide.*\b(700|701R|702|703R|704|802|970|971|972|973|974|1010|1012)\b', - // Texet Tablets and Readers http://www.texet.ru/tablet/ - 'TexetTablet' => 'NaviPad|TB-772A|TM-7045|TM-7055|TM-9750|TM-7016|TM-7024|TM-7026|TM-7041|TM-7043|TM-7047|TM-8041|TM-9741|TM-9747|TM-9748|TM-9751|TM-7022|TM-7021|TM-7020|TM-7011|TM-7010|TM-7023|TM-7025|TM-7037W|TM-7038W|TM-7027W|TM-9720|TM-9725|TM-9737W|TM-1020|TM-9738W|TM-9740|TM-9743W|TB-807A|TB-771A|TB-727A|TB-725A|TB-719A|TB-823A|TB-805A|TB-723A|TB-715A|TB-707A|TB-705A|TB-709A|TB-711A|TB-890HD|TB-880HD|TB-790HD|TB-780HD|TB-770HD|TB-721HD|TB-710HD|TB-434HD|TB-860HD|TB-840HD|TB-760HD|TB-750HD|TB-740HD|TB-730HD|TB-722HD|TB-720HD|TB-700HD|TB-500HD|TB-470HD|TB-431HD|TB-430HD|TB-506|TB-504|TB-446|TB-436|TB-416|TB-146SE|TB-126SE', - // Avoid detecting 'PLAYSTATION 3' as mobile. - 'PlaystationTablet' => 'Playstation.*(Portable|Vita)', - // http://www.trekstor.de/surftabs.html - 'TrekstorTablet' => 'ST10416-1|VT10416-1|ST70408-1|ST702xx-1|ST702xx-2|ST80208|ST97216|ST70104-2|VT10416-2|ST10216-2A|SurfTab', - // http://www.pyleaudio.com/Products.aspx?%2fproducts%2fPersonal-Electronics%2fTablets - 'PyleAudioTablet' => '\b(PTBL10CEU|PTBL10C|PTBL72BC|PTBL72BCEU|PTBL7CEU|PTBL7C|PTBL92BC|PTBL92BCEU|PTBL9CEU|PTBL9CUK|PTBL9C)\b', - // http://www.advandigital.com/index.php?link=content-product&jns=JP001 - // because of the short codenames we have to include whitespaces to reduce the possible conflicts. - 'AdvanTablet' => 'Android.* \b(E3A|T3X|T5C|T5B|T3E|T3C|T3B|T1J|T1F|T2A|T1H|T1i|E1C|T1-E|T5-A|T4|E1-B|T2Ci|T1-B|T1-D|O1-A|E1-A|T1-A|T3A|T4i)\b ', - // http://www.danytech.com/category/tablet-pc - 'DanyTechTablet' => 'Genius Tab G3|Genius Tab S2|Genius Tab Q3|Genius Tab G4|Genius Tab Q4|Genius Tab G-II|Genius TAB GII|Genius TAB GIII|Genius Tab S1', - // http://www.galapad.net/product.html - 'GalapadTablet' => 'Android.*\bG1\b', - // http://www.micromaxinfo.com/tablet/funbook - 'MicromaxTablet' => 'Funbook|Micromax.*\b(P250|P560|P360|P362|P600|P300|P350|P500|P275)\b', - // http://www.karbonnmobiles.com/products_tablet.php - 'KarbonnTablet' => 'Android.*\b(A39|A37|A34|ST8|ST10|ST7|Smart Tab3|Smart Tab2)\b', - // http://www.myallfine.com/Products.asp - 'AllFineTablet' => 'Fine7 Genius|Fine7 Shine|Fine7 Air|Fine8 Style|Fine9 More|Fine10 Joy|Fine11 Wide', - // http://www.proscanvideo.com/products-search.asp?itemClass=TABLET&itemnmbr= - 'PROSCANTablet' => '\b(PEM63|PLT1023G|PLT1041|PLT1044|PLT1044G|PLT1091|PLT4311|PLT4311PL|PLT4315|PLT7030|PLT7033|PLT7033D|PLT7035|PLT7035D|PLT7044K|PLT7045K|PLT7045KB|PLT7071KG|PLT7072|PLT7223G|PLT7225G|PLT7777G|PLT7810K|PLT7849G|PLT7851G|PLT7852G|PLT8015|PLT8031|PLT8034|PLT8036|PLT8080K|PLT8082|PLT8088|PLT8223G|PLT8234G|PLT8235G|PLT8816K|PLT9011|PLT9045K|PLT9233G|PLT9735|PLT9760G|PLT9770G)\b', - // http://www.yonesnav.com/products/products.php - 'YONESTablet' => 'BQ1078|BC1003|BC1077|RK9702|BC9730|BC9001|IT9001|BC7008|BC7010|BC708|BC728|BC7012|BC7030|BC7027|BC7026', - // http://www.cjshowroom.com/eproducts.aspx?classcode=004001001 - // China manufacturer makes tablets for different small brands (eg. http://www.zeepad.net/index.html) - 'ChangJiaTablet' => 'TPC7102|TPC7103|TPC7105|TPC7106|TPC7107|TPC7201|TPC7203|TPC7205|TPC7210|TPC7708|TPC7709|TPC7712|TPC7110|TPC8101|TPC8103|TPC8105|TPC8106|TPC8203|TPC8205|TPC8503|TPC9106|TPC9701|TPC97101|TPC97103|TPC97105|TPC97106|TPC97111|TPC97113|TPC97203|TPC97603|TPC97809|TPC97205|TPC10101|TPC10103|TPC10106|TPC10111|TPC10203|TPC10205|TPC10503', - // http://www.gloryunion.cn/products.asp - // http://www.allwinnertech.com/en/apply/mobile.html - // http://www.ptcl.com.pk/pd_content.php?pd_id=284 (EVOTAB) - // @todo: Softwiner tablets? - // aka. Cute or Cool tablets. Not sure yet, must research to avoid collisions. - 'GUTablet' => 'TX-A1301|TX-M9002|Q702|kf026', // A12R|D75A|D77|D79|R83|A95|A106C|R15|A75|A76|D71|D72|R71|R73|R77|D82|R85|D92|A97|D92|R91|A10F|A77F|W71F|A78F|W78F|W81F|A97F|W91F|W97F|R16G|C72|C73E|K72|K73|R96G - // http://www.pointofview-online.com/showroom.php?shop_mode=product_listing&category_id=118 - 'PointOfViewTablet' => 'TAB-P506|TAB-navi-7-3G-M|TAB-P517|TAB-P-527|TAB-P701|TAB-P703|TAB-P721|TAB-P731N|TAB-P741|TAB-P825|TAB-P905|TAB-P925|TAB-PR945|TAB-PL1015|TAB-P1025|TAB-PI1045|TAB-P1325|TAB-PROTAB[0-9]+|TAB-PROTAB25|TAB-PROTAB26|TAB-PROTAB27|TAB-PROTAB26XL|TAB-PROTAB2-IPS9|TAB-PROTAB30-IPS9|TAB-PROTAB25XXL|TAB-PROTAB26-IPS10|TAB-PROTAB30-IPS10', - // http://www.overmax.pl/pl/katalog-produktow,p8/tablety,c14/ - // @todo: add more tests. - 'OvermaxTablet' => 'OV-(SteelCore|NewBase|Basecore|Baseone|Exellen|Quattor|EduTab|Solution|ACTION|BasicTab|TeddyTab|MagicTab|Stream|TB-08|TB-09)', - // http://hclmetablet.com/India/index.php - 'HCLTablet' => 'HCL.*Tablet|Connect-3G-2.0|Connect-2G-2.0|ME Tablet U1|ME Tablet U2|ME Tablet G1|ME Tablet X1|ME Tablet Y2|ME Tablet Sync', - // http://www.edigital.hu/Tablet_es_e-book_olvaso/Tablet-c18385.html - 'DPSTablet' => 'DPS Dream 9|DPS Dual 7', - // http://www.visture.com/index.asp - 'VistureTablet' => 'V97 HD|i75 3G|Visture V4( HD)?|Visture V5( HD)?|Visture V10', - // http://www.mijncresta.nl/tablet - 'CrestaTablet' => 'CTP(-)?810|CTP(-)?818|CTP(-)?828|CTP(-)?838|CTP(-)?888|CTP(-)?978|CTP(-)?980|CTP(-)?987|CTP(-)?988|CTP(-)?989', - // MediaTek - http://www.mediatek.com/_en/01_products/02_proSys.php?cata_sn=1&cata1_sn=1&cata2_sn=309 - 'MediatekTablet' => '\bMT8125|MT8389|MT8135|MT8377\b', - // Concorde tab - 'ConcordeTablet' => 'Concorde([ ]+)?Tab|ConCorde ReadMan', - // GoClever Tablets - http://www.goclever.com/uk/products,c1/tablet,c5/ - 'GoCleverTablet' => 'GOCLEVER TAB|A7GOCLEVER|M1042|M7841|M742|R1042BK|R1041|TAB A975|TAB A7842|TAB A741|TAB A741L|TAB M723G|TAB M721|TAB A1021|TAB I921|TAB R721|TAB I720|TAB T76|TAB R70|TAB R76.2|TAB R106|TAB R83.2|TAB M813G|TAB I721|GCTA722|TAB I70|TAB I71|TAB S73|TAB R73|TAB R74|TAB R93|TAB R75|TAB R76.1|TAB A73|TAB A93|TAB A93.2|TAB T72|TAB R83|TAB R974|TAB R973|TAB A101|TAB A103|TAB A104|TAB A104.2|R105BK|M713G|A972BK|TAB A971|TAB R974.2|TAB R104|TAB R83.3|TAB A1042', - // Modecom Tablets - http://www.modecom.eu/tablets/portal/ - 'ModecomTablet' => 'FreeTAB 9000|FreeTAB 7.4|FreeTAB 7004|FreeTAB 7800|FreeTAB 2096|FreeTAB 7.5|FreeTAB 1014|FreeTAB 1001 |FreeTAB 8001|FreeTAB 9706|FreeTAB 9702|FreeTAB 7003|FreeTAB 7002|FreeTAB 1002|FreeTAB 7801|FreeTAB 1331|FreeTAB 1004|FreeTAB 8002|FreeTAB 8014|FreeTAB 9704|FreeTAB 1003', - // Vonino Tablets - http://www.vonino.eu/tablets - 'VoninoTablet' => '\b(Argus[ _]?S|Diamond[ _]?79HD|Emerald[ _]?78E|Luna[ _]?70C|Onyx[ _]?S|Onyx[ _]?Z|Orin[ _]?HD|Orin[ _]?S|Otis[ _]?S|SpeedStar[ _]?S|Magnet[ _]?M9|Primus[ _]?94[ _]?3G|Primus[ _]?94HD|Primus[ _]?QS|Android.*\bQ8\b|Sirius[ _]?EVO[ _]?QS|Sirius[ _]?QS|Spirit[ _]?S)\b', - // ECS Tablets - http://www.ecs.com.tw/ECSWebSite/Product/Product_Tablet_List.aspx?CategoryID=14&MenuID=107&childid=M_107&LanID=0 - 'ECSTablet' => 'V07OT2|TM105A|S10OT1|TR10CS1', - // Storex Tablets - http://storex.fr/espace_client/support.html - // @note: no need to add all the tablet codes since they are guided by the first regex. - 'StorexTablet' => 'eZee[_\']?(Tab|Go)[0-9]+|TabLC7|Looney Tunes Tab', - // Generic Vodafone tablets. - 'VodafoneTablet' => 'SmartTab([ ]+)?[0-9]+|SmartTabII10|SmartTabII7|VF-1497', - // French tablets - Essentiel B http://www.boulanger.fr/tablette_tactile_e-book/tablette_tactile_essentiel_b/cl_68908.htm?multiChoiceToDelete=brand&mc_brand=essentielb - // Aka: http://www.essentielb.fr/ - 'EssentielBTablet' => 'Smart[ \']?TAB[ ]+?[0-9]+|Family[ \']?TAB2', - // Ross & Moor - http://ross-moor.ru/ - 'RossMoorTablet' => 'RM-790|RM-997|RMD-878G|RMD-974R|RMT-705A|RMT-701|RME-601|RMT-501|RMT-711', - // i-mobile http://product.i-mobilephone.com/Mobile_Device - 'iMobileTablet' => 'i-mobile i-note', - // http://www.tolino.de/de/vergleichen/ - 'TolinoTablet' => 'tolino tab [0-9.]+|tolino shine', - // AudioSonic - a Kmart brand - // http://www.kmart.com.au/webapp/wcs/stores/servlet/Search?langId=-1&storeId=10701&catalogId=10001&categoryId=193001&pageSize=72¤tPage=1&searchCategory=193001%2b4294965664&sortBy=p_MaxPrice%7c1 - 'AudioSonicTablet' => '\bC-22Q|T7-QC|T-17B|T-17P\b', - // AMPE Tablets - http://www.ampe.com.my/product-category/tablets/ - // @todo: add them gradually to avoid conflicts. - 'AMPETablet' => 'Android.* A78 ', - // Skk Mobile - http://skkmobile.com.ph/product_tablets.php - 'SkkTablet' => 'Android.* (SKYPAD|PHOENIX|CYCLOPS)', - // Tecno Mobile (only tablet) - http://www.tecno-mobile.com/index.php/product?filterby=smart&list_order=all&page=1 - 'TecnoTablet' => 'TECNO P9', - // JXD (consoles & tablets) - http://jxd.hk/products.asp?selectclassid=009008&clsid=3 - 'JXDTablet' => 'Android.* \b(F3000|A3300|JXD5000|JXD3000|JXD2000|JXD300B|JXD300|S5800|S7800|S602b|S5110b|S7300|S5300|S602|S603|S5100|S5110|S601|S7100a|P3000F|P3000s|P101|P200s|P1000m|P200m|P9100|P1000s|S6600b|S908|P1000|P300|S18|S6600|S9100)\b', - // i-Joy tablets - http://www.i-joy.es/en/cat/products/tablets/ - 'iJoyTablet' => 'Tablet (Spirit 7|Essentia|Galatea|Fusion|Onix 7|Landa|Titan|Scooby|Deox|Stella|Themis|Argon|Unique 7|Sygnus|Hexen|Finity 7|Cream|Cream X2|Jade|Neon 7|Neron 7|Kandy|Scape|Saphyr 7|Rebel|Biox|Rebel|Rebel 8GB|Myst|Draco 7|Myst|Tab7-004|Myst|Tadeo Jones|Tablet Boing|Arrow|Draco Dual Cam|Aurix|Mint|Amity|Revolution|Finity 9|Neon 9|T9w|Amity 4GB Dual Cam|Stone 4GB|Stone 8GB|Andromeda|Silken|X2|Andromeda II|Halley|Flame|Saphyr 9,7|Touch 8|Planet|Triton|Unique 10|Hexen 10|Memphis 4GB|Memphis 8GB|Onix 10)', - // http://www.intracon.eu/tablet - 'FX2Tablet' => 'FX2 PAD7|FX2 PAD10', - // http://www.xoro.de/produkte/ - // @note: Might be the same brand with 'Simply tablets' - 'XoroTablet' => 'KidsPAD 701|PAD[ ]?712|PAD[ ]?714|PAD[ ]?716|PAD[ ]?717|PAD[ ]?718|PAD[ ]?720|PAD[ ]?721|PAD[ ]?722|PAD[ ]?790|PAD[ ]?792|PAD[ ]?900|PAD[ ]?9715D|PAD[ ]?9716DR|PAD[ ]?9718DR|PAD[ ]?9719QR|PAD[ ]?9720QR|TelePAD1030|Telepad1032|TelePAD730|TelePAD731|TelePAD732|TelePAD735Q|TelePAD830|TelePAD9730|TelePAD795|MegaPAD 1331|MegaPAD 1851|MegaPAD 2151', - // http://www1.viewsonic.com/products/computing/tablets/ - 'ViewsonicTablet' => 'ViewPad 10pi|ViewPad 10e|ViewPad 10s|ViewPad E72|ViewPad7|ViewPad E100|ViewPad 7e|ViewSonic VB733|VB100a', - // http://www.odys.de/web/internet-tablet_en.html - 'OdysTablet' => 'LOOX|XENO10|ODYS[ -](Space|EVO|Xpress|NOON)|\bXELIO\b|Xelio10Pro|XELIO7PHONETAB|XELIO10EXTREME|XELIOPT2|NEO_QUAD10', - // http://www.captiva-power.de/products.html#tablets-en - 'CaptivaTablet' => 'CAPTIVA PAD', - // IconBIT - http://www.iconbit.com/products/tablets/ - 'IconbitTablet' => 'NetTAB|NT-3702|NT-3702S|NT-3702S|NT-3603P|NT-3603P|NT-0704S|NT-0704S|NT-3805C|NT-3805C|NT-0806C|NT-0806C|NT-0909T|NT-0909T|NT-0907S|NT-0907S|NT-0902S|NT-0902S', - // http://www.teclast.com/topic.php?channelID=70&topicID=140&pid=63 - 'TeclastTablet' => 'T98 4G|\bP80\b|\bX90HD\b|X98 Air|X98 Air 3G|\bX89\b|P80 3G|\bX80h\b|P98 Air|\bX89HD\b|P98 3G|\bP90HD\b|P89 3G|X98 3G|\bP70h\b|P79HD 3G|G18d 3G|\bP79HD\b|\bP89s\b|\bA88\b|\bP10HD\b|\bP19HD\b|G18 3G|\bP78HD\b|\bA78\b|\bP75\b|G17s 3G|G17h 3G|\bP85t\b|\bP90\b|\bP11\b|\bP98t\b|\bP98HD\b|\bG18d\b|\bP85s\b|\bP11HD\b|\bP88s\b|\bA80HD\b|\bA80se\b|\bA10h\b|\bP89\b|\bP78s\b|\bG18\b|\bP85\b|\bA70h\b|\bA70\b|\bG17\b|\bP18\b|\bA80s\b|\bA11s\b|\bP88HD\b|\bA80h\b|\bP76s\b|\bP76h\b|\bP98\b|\bA10HD\b|\bP78\b|\bP88\b|\bA11\b|\bA10t\b|\bP76a\b|\bP76t\b|\bP76e\b|\bP85HD\b|\bP85a\b|\bP86\b|\bP75HD\b|\bP76v\b|\bA12\b|\bP75a\b|\bA15\b|\bP76Ti\b|\bP81HD\b|\bA10\b|\bT760VE\b|\bT720HD\b|\bP76\b|\bP73\b|\bP71\b|\bP72\b|\bT720SE\b|\bC520Ti\b|\bT760\b|\bT720VE\b|T720-3GE|T720-WiFi', - // Onda - http://www.onda-tablet.com/buy-android-onda.html?dir=desc&limit=all&order=price - 'OndaTablet' => '\b(V975i|Vi30|VX530|V701|Vi60|V701s|Vi50|V801s|V719|Vx610w|VX610W|V819i|Vi10|VX580W|Vi10|V711s|V813|V811|V820w|V820|Vi20|V711|VI30W|V712|V891w|V972|V819w|V820w|Vi60|V820w|V711|V813s|V801|V819|V975s|V801|V819|V819|V818|V811|V712|V975m|V101w|V961w|V812|V818|V971|V971s|V919|V989|V116w|V102w|V973|Vi40)\b[\s]+', - 'JaytechTablet' => 'TPC-PA762', - 'BlaupunktTablet' => 'Endeavour 800NG|Endeavour 1010', - // http://www.digma.ru/support/download/ - // @todo: Ebooks also (if requested) - 'DigmaTablet' => '\b(iDx10|iDx9|iDx8|iDx7|iDxD7|iDxD8|iDsQ8|iDsQ7|iDsQ8|iDsD10|iDnD7|3TS804H|iDsQ11|iDj7|iDs10)\b', - // http://www.evolioshop.com/ro/tablete-pc.html - // http://www.evolio.ro/support/downloads_static.html?cat=2 - // @todo: Research some more - 'EvolioTablet' => 'ARIA_Mini_wifi|Aria[ _]Mini|Evolio X10|Evolio X7|Evolio X8|\bEvotab\b|\bNeura\b', - // @todo http://www.lavamobiles.com/tablets-data-cards - 'LavaTablet' => 'QPAD E704|\bIvoryS\b|E-TAB IVORY|\bE-TAB\b', - // http://www.breezetablet.com/ - 'AocTablet' => 'MW0811|MW0812|MW0922|MTK8382|MW1031|MW0831|MW0821|MW0931|MW0712', - // http://www.mpmaneurope.com/en/products/internet-tablets-14/android-tablets-14/ - 'MpmanTablet' => 'MP11 OCTA|MP10 OCTA|MPQC1114|MPQC1004|MPQC994|MPQC974|MPQC973|MPQC804|MPQC784|MPQC780|\bMPG7\b|MPDCG75|MPDCG71|MPDC1006|MP101DC|MPDC9000|MPDC905|MPDC706HD|MPDC706|MPDC705|MPDC110|MPDC100|MPDC99|MPDC97|MPDC88|MPDC8|MPDC77|MP709|MID701|MID711|MID170|MPDC703|MPQC1010', - // https://www.celkonmobiles.com/?_a=categoryphones&sid=2 - 'CelkonTablet' => 'CT695|CT888|CT[\s]?910|CT7 Tab|CT9 Tab|CT3 Tab|CT2 Tab|CT1 Tab|C820|C720|\bCT-1\b', - // http://www.wolderelectronics.com/productos/manuales-y-guias-rapidas/categoria-2-miTab - 'WolderTablet' => 'miTab \b(DIAMOND|SPACE|BROOKLYN|NEO|FLY|MANHATTAN|FUNK|EVOLUTION|SKY|GOCAR|IRON|GENIUS|POP|MINT|EPSILON|BROADWAY|JUMP|HOP|LEGEND|NEW AGE|LINE|ADVANCE|FEEL|FOLLOW|LIKE|LINK|LIVE|THINK|FREEDOM|CHICAGO|CLEVELAND|BALTIMORE-GH|IOWA|BOSTON|SEATTLE|PHOENIX|DALLAS|IN 101|MasterChef)\b', - // http://www.mi.com/en - 'MiTablet' => '\bMI PAD\b|\bHM NOTE 1W\b', - // http://www.nbru.cn/index.html - 'NibiruTablet' => 'Nibiru M1|Nibiru Jupiter One', - // http://navroad.com/products/produkty/tablety/ - 'NexoTablet' => 'NEXO NOVA|NEXO 10|NEXO AVIO|NEXO FREE|NEXO GO|NEXO EVO|NEXO 3G|NEXO SMART|NEXO KIDDO|NEXO MOBI', - // http://leader-online.com/new_site/product-category/tablets/ - // http://www.leader-online.net.au/List/Tablet - 'LeaderTablet' => 'TBLT10Q|TBLT10I|TBL-10WDKB|TBL-10WDKBO2013|TBL-W230V2|TBL-W450|TBL-W500|SV572|TBLT7I|TBA-AC7-8G|TBLT79|TBL-8W16|TBL-10W32|TBL-10WKB|TBL-W100', - // http://www.datawind.com/ubislate/ - 'UbislateTablet' => 'UbiSlate[\s]?7C', - // http://www.pocketbook-int.com/ru/support - 'PocketBookTablet' => 'Pocketbook', - // http://www.kocaso.com/product_tablet.html - 'KocasoTablet' => '\b(TB-1207)\b', - // http://global.hisense.com/product/asia/tablet/Sero7/201412/t20141215_91832.htm - 'HisenseTablet' => '\b(F5281|E2371)\b', - // http://www.tesco.com/direct/hudl/ - 'Hudl' => 'Hudl HT7S3|Hudl 2', - // http://www.telstra.com.au/home-phone/thub-2/ - 'TelstraTablet' => 'T-Hub2', - 'GenericTablet' => 'Android.*\b97D\b|Tablet(?!.*PC)|BNTV250A|MID-WCDMA|LogicPD Zoom2|\bA7EB\b|CatNova8|A1_07|CT704|CT1002|\bM721\b|rk30sdk|\bEVOTAB\b|M758A|ET904|ALUMIUM10|Smartfren Tab|Endeavour 1010|Tablet-PC-4|Tagi Tab|\bM6pro\b|CT1020W|arc 10HD|\bTP750\b' - ); - - /** - * List of mobile Operating Systems. - * - * @var array - */ - protected static $operatingSystems = array( - 'AndroidOS' => 'Android', - 'BlackBerryOS' => 'blackberry|\bBB10\b|rim tablet os', - 'PalmOS' => 'PalmOS|avantgo|blazer|elaine|hiptop|palm|plucker|xiino', - 'SymbianOS' => 'Symbian|SymbOS|Series60|Series40|SYB-[0-9]+|\bS60\b', - // @reference: http://en.wikipedia.org/wiki/Windows_Mobile - 'WindowsMobileOS' => 'Windows CE.*(PPC|Smartphone|Mobile|[0-9]{3}x[0-9]{3})|Window Mobile|Windows Phone [0-9.]+|WCE;', - // @reference: http://en.wikipedia.org/wiki/Windows_Phone - // http://wifeng.cn/?r=blog&a=view&id=106 - // http://nicksnettravels.builttoroam.com/post/2011/01/10/Bogus-Windows-Phone-7-User-Agent-String.aspx - // http://msdn.microsoft.com/library/ms537503.aspx - // https://msdn.microsoft.com/en-us/library/hh869301(v=vs.85).aspx - 'WindowsPhoneOS' => 'Windows Phone 10.0|Windows Phone 8.1|Windows Phone 8.0|Windows Phone OS|XBLWP7|ZuneWP7|Windows NT 6.[23]; ARM;', - 'iOS' => '\biPhone.*Mobile|\biPod|\biPad', - // http://en.wikipedia.org/wiki/MeeGo - // @todo: research MeeGo in UAs - 'MeeGoOS' => 'MeeGo', - // http://en.wikipedia.org/wiki/Maemo - // @todo: research Maemo in UAs - 'MaemoOS' => 'Maemo', - 'JavaOS' => 'J2ME/|\bMIDP\b|\bCLDC\b', // '|Java/' produces bug #135 - 'webOS' => 'webOS|hpwOS', - 'badaOS' => '\bBada\b', - 'BREWOS' => 'BREW', - ); - - /** - * List of mobile User Agents. - * - * IMPORTANT: This is a list of only mobile browsers. - * Mobile Detect 2.x supports only mobile browsers, - * it was never designed to detect all browsers. - * The change will come in 2017 in the 3.x release for PHP7. - * - * @var array - */ - protected static $browsers = array( - //'Vivaldi' => 'Vivaldi', - // @reference: https://developers.google.com/chrome/mobile/docs/user-agent - 'Chrome' => '\bCrMo\b|CriOS|Android.*Chrome/[.0-9]* (Mobile)?', - 'Dolfin' => '\bDolfin\b', - 'Opera' => 'Opera.*Mini|Opera.*Mobi|Android.*Opera|Mobile.*OPR/[0-9.]+|Coast/[0-9.]+', - 'Skyfire' => 'Skyfire', - 'Edge' => 'Mobile Safari/[.0-9]* Edge', - 'IE' => 'IEMobile|MSIEMobile', // |Trident/[.0-9]+ - 'Firefox' => 'fennec|firefox.*maemo|(Mobile|Tablet).*Firefox|Firefox.*Mobile|FxiOS', - 'Bolt' => 'bolt', - 'TeaShark' => 'teashark', - 'Blazer' => 'Blazer', - // @reference: http://developer.apple.com/library/safari/#documentation/AppleApplications/Reference/SafariWebContent/OptimizingforSafarioniPhone/OptimizingforSafarioniPhone.html#//apple_ref/doc/uid/TP40006517-SW3 - 'Safari' => 'Version.*Mobile.*Safari|Safari.*Mobile|MobileSafari', - // http://en.wikipedia.org/wiki/Midori_(web_browser) - //'Midori' => 'midori', - //'Tizen' => 'Tizen', - 'UCBrowser' => 'UC.*Browser|UCWEB', - 'baiduboxapp' => 'baiduboxapp', - 'baidubrowser' => 'baidubrowser', - // https://github.com/serbanghita/Mobile-Detect/issues/7 - 'DiigoBrowser' => 'DiigoBrowser', - // http://www.puffinbrowser.com/index.php - 'Puffin' => 'Puffin', - // http://mercury-browser.com/index.html - 'Mercury' => '\bMercury\b', - // http://en.wikipedia.org/wiki/Obigo_Browser - 'ObigoBrowser' => 'Obigo', - // http://en.wikipedia.org/wiki/NetFront - 'NetFront' => 'NF-Browser', - // @reference: http://en.wikipedia.org/wiki/Minimo - // http://en.wikipedia.org/wiki/Vision_Mobile_Browser - 'GenericBrowser' => 'NokiaBrowser|OviBrowser|OneBrowser|TwonkyBeamBrowser|SEMC.*Browser|FlyFlow|Minimo|NetFront|Novarra-Vision|MQQBrowser|MicroMessenger', - // @reference: https://en.wikipedia.org/wiki/Pale_Moon_(web_browser) - 'PaleMoon' => 'Android.*PaleMoon|Mobile.*PaleMoon', - ); - - /** - * Utilities. - * - * @var array - */ - protected static $utilities = array( - // Experimental. When a mobile device wants to switch to 'Desktop Mode'. - // http://scottcate.com/technology/windows-phone-8-ie10-desktop-or-mobile/ - // https://github.com/serbanghita/Mobile-Detect/issues/57#issuecomment-15024011 - // https://developers.facebook.com/docs/sharing/best-practices - 'Bot' => 'Googlebot|facebookexternalhit|AdsBot-Google|Google Keyword Suggestion|Facebot|YandexBot|YandexMobileBot|bingbot|ia_archiver|AhrefsBot|Ezooms|GSLFbot|WBSearchBot|Twitterbot|TweetmemeBot|Twikle|PaperLiBot|Wotbox|UnwindFetchor|Exabot|MJ12bot|YandexImages|TurnitinBot|Pingdom', - 'MobileBot' => 'Googlebot-Mobile|AdsBot-Google-Mobile|YahooSeeker/M1A1-R2D2', - 'DesktopMode' => 'WPDesktop', - 'TV' => 'SonyDTV|HbbTV', // experimental - 'WebKit' => '(webkit)[ /]([\w.]+)', - // @todo: Include JXD consoles. - 'Console' => '\b(Nintendo|Nintendo WiiU|Nintendo 3DS|PLAYSTATION|Xbox)\b', - 'Watch' => 'SM-V700', - ); - - /** - * All possible HTTP headers that represent the - * User-Agent string. - * - * @var array - */ - protected static $uaHttpHeaders = array( - // The default User-Agent string. - 'HTTP_USER_AGENT', - // Header can occur on devices using Opera Mini. - 'HTTP_X_OPERAMINI_PHONE_UA', - // Vodafone specific header: http://www.seoprinciple.com/mobile-web-community-still-angry-at-vodafone/24/ - 'HTTP_X_DEVICE_USER_AGENT', - 'HTTP_X_ORIGINAL_USER_AGENT', - 'HTTP_X_SKYFIRE_PHONE', - 'HTTP_X_BOLT_PHONE_UA', - 'HTTP_DEVICE_STOCK_UA', - 'HTTP_X_UCBROWSER_DEVICE_UA' - ); - - /** - * The individual segments that could exist in a User-Agent string. VER refers to the regular - * expression defined in the constant self::VER. - * - * @var array - */ - protected static $properties = array( - - // Build - 'Mobile' => 'Mobile/[VER]', - 'Build' => 'Build/[VER]', - 'Version' => 'Version/[VER]', - 'VendorID' => 'VendorID/[VER]', - - // Devices - 'iPad' => 'iPad.*CPU[a-z ]+[VER]', - 'iPhone' => 'iPhone.*CPU[a-z ]+[VER]', - 'iPod' => 'iPod.*CPU[a-z ]+[VER]', - //'BlackBerry' => array('BlackBerry[VER]', 'BlackBerry [VER];'), - 'Kindle' => 'Kindle/[VER]', - - // Browser - 'Chrome' => array('Chrome/[VER]', 'CriOS/[VER]', 'CrMo/[VER]'), - 'Coast' => array('Coast/[VER]'), - 'Dolfin' => 'Dolfin/[VER]', - // @reference: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/User-Agent/Firefox - 'Firefox' => array('Firefox/[VER]', 'FxiOS/[VER]'), - 'Fennec' => 'Fennec/[VER]', - // http://msdn.microsoft.com/en-us/library/ms537503(v=vs.85).aspx - // https://msdn.microsoft.com/en-us/library/ie/hh869301(v=vs.85).aspx - 'Edge' => 'Edge/[VER]', - 'IE' => array('IEMobile/[VER];', 'IEMobile [VER]', 'MSIE [VER];', 'Trident/[0-9.]+;.*rv:[VER]'), - // http://en.wikipedia.org/wiki/NetFront - 'NetFront' => 'NetFront/[VER]', - 'NokiaBrowser' => 'NokiaBrowser/[VER]', - 'Opera' => array( ' OPR/[VER]', 'Opera Mini/[VER]', 'Version/[VER]' ), - 'Opera Mini' => 'Opera Mini/[VER]', - 'Opera Mobi' => 'Version/[VER]', - 'UC Browser' => 'UC Browser[VER]', - 'MQQBrowser' => 'MQQBrowser/[VER]', - 'MicroMessenger' => 'MicroMessenger/[VER]', - 'baiduboxapp' => 'baiduboxapp/[VER]', - 'baidubrowser' => 'baidubrowser/[VER]', - 'SamsungBrowser' => 'SamsungBrowser/[VER]', - 'Iron' => 'Iron/[VER]', - // @note: Safari 7534.48.3 is actually Version 5.1. - // @note: On BlackBerry the Version is overwriten by the OS. - 'Safari' => array( 'Version/[VER]', 'Safari/[VER]' ), - 'Skyfire' => 'Skyfire/[VER]', - 'Tizen' => 'Tizen/[VER]', - 'Webkit' => 'webkit[ /][VER]', - 'PaleMoon' => 'PaleMoon/[VER]', - - // Engine - 'Gecko' => 'Gecko/[VER]', - 'Trident' => 'Trident/[VER]', - 'Presto' => 'Presto/[VER]', - 'Goanna' => 'Goanna/[VER]', - - // OS - 'iOS' => ' \bi?OS\b [VER][ ;]{1}', - 'Android' => 'Android [VER]', - 'BlackBerry' => array('BlackBerry[\w]+/[VER]', 'BlackBerry.*Version/[VER]', 'Version/[VER]'), - 'BREW' => 'BREW [VER]', - 'Java' => 'Java/[VER]', - // @reference: http://windowsteamblog.com/windows_phone/b/wpdev/archive/2011/08/29/introducing-the-ie9-on-windows-phone-mango-user-agent-string.aspx - // @reference: http://en.wikipedia.org/wiki/Windows_NT#Releases - 'Windows Phone OS' => array( 'Windows Phone OS [VER]', 'Windows Phone [VER]'), - 'Windows Phone' => 'Windows Phone [VER]', - 'Windows CE' => 'Windows CE/[VER]', - // http://social.msdn.microsoft.com/Forums/en-US/windowsdeveloperpreviewgeneral/thread/6be392da-4d2f-41b4-8354-8dcee20c85cd - 'Windows NT' => 'Windows NT [VER]', - 'Symbian' => array('SymbianOS/[VER]', 'Symbian/[VER]'), - 'webOS' => array('webOS/[VER]', 'hpwOS/[VER];'), - ); - - /** - * Construct an instance of this class. - * - * @param array $headers Specify the headers as injection. Should be PHP _SERVER flavored. - * If left empty, will use the global _SERVER['HTTP_*'] vars instead. - * @param string $userAgent Inject the User-Agent header. If null, will use HTTP_USER_AGENT - * from the $headers array instead. - */ - public function __construct( - array $headers = null, - $userAgent = null - ) { - $this->setHttpHeaders($headers); - $this->setUserAgent($userAgent); - } - - /** - * Get the current script version. - * This is useful for the demo.php file, - * so people can check on what version they are testing - * for mobile devices. - * - * @return string The version number in semantic version format. - */ - public static function getScriptVersion() - { - return self::VERSION; - } - - /** - * Set the HTTP Headers. Must be PHP-flavored. This method will reset existing headers. - * - * @param array $httpHeaders The headers to set. If null, then using PHP's _SERVER to extract - * the headers. The default null is left for backwards compatibility. - */ - public function setHttpHeaders($httpHeaders = null) - { - // use global _SERVER if $httpHeaders aren't defined - if (!is_array($httpHeaders) || !count($httpHeaders)) { - $httpHeaders = $_SERVER; - } - - // clear existing headers - $this->httpHeaders = array(); - - // Only save HTTP headers. In PHP land, that means only _SERVER vars that - // start with HTTP_. - foreach ($httpHeaders as $key => $value) { - if (substr($key, 0, 5) === 'HTTP_') { - $this->httpHeaders[$key] = $value; - } - } - - // In case we're dealing with CloudFront, we need to know. - $this->setCfHeaders($httpHeaders); - } - - /** - * Retrieves the HTTP headers. - * - * @return array - */ - public function getHttpHeaders() - { - return $this->httpHeaders; - } - - /** - * Retrieves a particular header. If it doesn't exist, no exception/error is caused. - * Simply null is returned. - * - * @param string $header The name of the header to retrieve. Can be HTTP compliant such as - * "User-Agent" or "X-Device-User-Agent" or can be php-esque with the - * all-caps, HTTP_ prefixed, underscore seperated awesomeness. - * - * @return string|null The value of the header. - */ - public function getHttpHeader($header) - { - // are we using PHP-flavored headers? - if (strpos($header, '_') === false) { - $header = str_replace('-', '_', $header); - $header = strtoupper($header); - } - - // test the alternate, too - $altHeader = 'HTTP_' . $header; - - //Test both the regular and the HTTP_ prefix - if (isset($this->httpHeaders[$header])) { - return $this->httpHeaders[$header]; - } elseif (isset($this->httpHeaders[$altHeader])) { - return $this->httpHeaders[$altHeader]; - } - - return null; - } - - public function getMobileHeaders() - { - return self::$mobileHeaders; - } - - /** - * Get all possible HTTP headers that - * can contain the User-Agent string. - * - * @return array List of HTTP headers. - */ - public function getUaHttpHeaders() - { - return self::$uaHttpHeaders; - } - - - /** - * Set CloudFront headers - * http://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/header-caching.html#header-caching-web-device - * - * @param array $cfHeaders List of HTTP headers - * - * @return boolean If there were CloudFront headers to be set - */ - public function setCfHeaders($cfHeaders = null) { - // use global _SERVER if $cfHeaders aren't defined - if (!is_array($cfHeaders) || !count($cfHeaders)) { - $cfHeaders = $_SERVER; - } - - // clear existing headers - $this->cloudfrontHeaders = array(); - - // Only save CLOUDFRONT headers. In PHP land, that means only _SERVER vars that - // start with cloudfront-. - $response = false; - foreach ($cfHeaders as $key => $value) { - if (substr(strtolower($key), 0, 16) === 'http_cloudfront_') { - $this->cloudfrontHeaders[strtoupper($key)] = $value; - $response = true; - } - } - - return $response; - } - - /** - * Retrieves the cloudfront headers. - * - * @return array - */ - public function getCfHeaders() - { - return $this->cloudfrontHeaders; - } - - /** - * Set the User-Agent to be used. - * - * @param string $userAgent The user agent string to set. - * - * @return string|null - */ - public function setUserAgent($userAgent = null) - { - // Invalidate cache due to #375 - $this->cache = array(); - - if (false === empty($userAgent)) { - return $this->userAgent = $userAgent; - } else { - $this->userAgent = null; - foreach ($this->getUaHttpHeaders() as $altHeader) { - if (false === empty($this->httpHeaders[$altHeader])) { // @todo: should use getHttpHeader(), but it would be slow. (Serban) - $this->userAgent .= $this->httpHeaders[$altHeader] . " "; - } - } - - if (!empty($this->userAgent)) { - return $this->userAgent = trim($this->userAgent); - } - } - - if (count($this->getCfHeaders()) > 0) { - return $this->userAgent = 'Amazon CloudFront'; - } - return $this->userAgent = null; - } - - /** - * Retrieve the User-Agent. - * - * @return string|null The user agent if it's set. - */ - public function getUserAgent() - { - return $this->userAgent; - } - - /** - * Set the detection type. Must be one of self::DETECTION_TYPE_MOBILE or - * self::DETECTION_TYPE_EXTENDED. Otherwise, nothing is set. - * - * @deprecated since version 2.6.9 - * - * @param string $type The type. Must be a self::DETECTION_TYPE_* constant. The default - * parameter is null which will default to self::DETECTION_TYPE_MOBILE. - */ - public function setDetectionType($type = null) - { - if ($type === null) { - $type = self::DETECTION_TYPE_MOBILE; - } - - if ($type !== self::DETECTION_TYPE_MOBILE && $type !== self::DETECTION_TYPE_EXTENDED) { - return; - } - - $this->detectionType = $type; - } - - public function getMatchingRegex() - { - return $this->matchingRegex; - } - - public function getMatchesArray() - { - return $this->matchesArray; - } - - /** - * Retrieve the list of known phone devices. - * - * @return array List of phone devices. - */ - public static function getPhoneDevices() - { - return self::$phoneDevices; - } - - /** - * Retrieve the list of known tablet devices. - * - * @return array List of tablet devices. - */ - public static function getTabletDevices() - { - return self::$tabletDevices; - } - - /** - * Alias for getBrowsers() method. - * - * @return array List of user agents. - */ - public static function getUserAgents() - { - return self::getBrowsers(); - } - - /** - * Retrieve the list of known browsers. Specifically, the user agents. - * - * @return array List of browsers / user agents. - */ - public static function getBrowsers() - { - return self::$browsers; - } - - /** - * Retrieve the list of known utilities. - * - * @return array List of utilities. - */ - public static function getUtilities() - { - return self::$utilities; - } - - /** - * Method gets the mobile detection rules. This method is used for the magic methods $detect->is*(). - * - * @deprecated since version 2.6.9 - * - * @return array All the rules (but not extended). - */ - public static function getMobileDetectionRules() - { - static $rules; - - if (!$rules) { - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers - ); - } - - return $rules; - - } - - /** - * Method gets the mobile detection rules + utilities. - * The reason this is separate is because utilities rules - * don't necessary imply mobile. This method is used inside - * the new $detect->is('stuff') method. - * - * @deprecated since version 2.6.9 - * - * @return array All the rules + extended. - */ - public function getMobileDetectionRulesExtended() - { - static $rules; - - if (!$rules) { - // Merge all rules together. - $rules = array_merge( - self::$phoneDevices, - self::$tabletDevices, - self::$operatingSystems, - self::$browsers, - self::$utilities - ); - } - - return $rules; - } - - /** - * Retrieve the current set of rules. - * - * @deprecated since version 2.6.9 - * - * @return array - */ - public function getRules() - { - if ($this->detectionType == self::DETECTION_TYPE_EXTENDED) { - return self::getMobileDetectionRulesExtended(); - } else { - return self::getMobileDetectionRules(); - } - } - - /** - * Retrieve the list of mobile operating systems. - * - * @return array The list of mobile operating systems. - */ - public static function getOperatingSystems() - { - return self::$operatingSystems; - } - - /** - * Check the HTTP headers for signs of mobile. - * This is the fastest mobile check possible; it's used - * inside isMobile() method. - * - * @return bool - */ - public function checkHttpHeadersForMobile() - { - - foreach ($this->getMobileHeaders() as $mobileHeader => $matchType) { - if (isset($this->httpHeaders[$mobileHeader])) { - if (is_array($matchType['matches'])) { - foreach ($matchType['matches'] as $_match) { - if (strpos($this->httpHeaders[$mobileHeader], $_match) !== false) { - return true; - } - } - - return false; - } else { - return true; - } - } - } - - return false; - - } - - /** - * Magic overloading method. - * - * @method boolean is[...]() - * @param string $name - * @param array $arguments - * @return mixed - * @throws BadMethodCallException when the method doesn't exist and doesn't start with 'is' - */ - public function __call($name, $arguments) - { - // make sure the name starts with 'is', otherwise - if (substr($name, 0, 2) !== 'is') { - throw new BadMethodCallException("No such method exists: $name"); - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - $key = substr($name, 2); - - return $this->matchUAAgainstKey($key); - } - - /** - * Find a detection rule that matches the current User-agent. - * - * @param null $userAgent deprecated - * @return boolean - */ - protected function matchDetectionRulesAgainstUA($userAgent = null) - { - // Begin general search. - foreach ($this->getRules() as $_regex) { - if (empty($_regex)) { - continue; - } - - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * Search for a certain key in the rules array. - * If the key is found then try to match the corresponding - * regex against the User-Agent. - * - * @param string $key - * - * @return boolean - */ - protected function matchUAAgainstKey($key) - { - // Make the keys lowercase so we can match: isIphone(), isiPhone(), isiphone(), etc. - $key = strtolower($key); - if (false === isset($this->cache[$key])) { - - // change the keys to lower case - $_rules = array_change_key_case($this->getRules()); - - if (false === empty($_rules[$key])) { - $this->cache[$key] = $this->match($_rules[$key]); - } - - if (false === isset($this->cache[$key])) { - $this->cache[$key] = false; - } - } - - return $this->cache[$key]; - } - - /** - * Check if the device is mobile. - * Returns true if any type of mobile device detected, including special ones - * @param null $userAgent deprecated - * @param null $httpHeaders deprecated - * @return bool - */ - public function isMobile($userAgent = null, $httpHeaders = null) - { - - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - // Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront' - if ($this->getUserAgent() === 'Amazon CloudFront') { - $cfHeaders = $this->getCfHeaders(); - if(array_key_exists('HTTP_CLOUDFRONT_IS_MOBILE_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_MOBILE_VIEWER'] === 'true') { - return true; - } - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - if ($this->checkHttpHeadersForMobile()) { - return true; - } else { - return $this->matchDetectionRulesAgainstUA(); - } - - } - - /** - * Check if the device is a tablet. - * Return true if any type of tablet device is detected. - * - * @param string $userAgent deprecated - * @param array $httpHeaders deprecated - * @return bool - */ - public function isTablet($userAgent = null, $httpHeaders = null) - { - // Check specifically for cloudfront headers if the useragent === 'Amazon CloudFront' - if ($this->getUserAgent() === 'Amazon CloudFront') { - $cfHeaders = $this->getCfHeaders(); - if(array_key_exists('HTTP_CLOUDFRONT_IS_TABLET_VIEWER', $cfHeaders) && $cfHeaders['HTTP_CLOUDFRONT_IS_TABLET_VIEWER'] === 'true') { - return true; - } - } - - $this->setDetectionType(self::DETECTION_TYPE_MOBILE); - - foreach (self::$tabletDevices as $_regex) { - if ($this->match($_regex, $userAgent)) { - return true; - } - } - - return false; - } - - /** - * This method checks for a certain property in the - * userAgent. - * @todo: The httpHeaders part is not yet used. - * - * @param string $key - * @param string $userAgent deprecated - * @param string $httpHeaders deprecated - * @return bool|int|null - */ - public function is($key, $userAgent = null, $httpHeaders = null) - { - // Set the UA and HTTP headers only if needed (eg. batch mode). - if ($httpHeaders) { - $this->setHttpHeaders($httpHeaders); - } - - if ($userAgent) { - $this->setUserAgent($userAgent); - } - - $this->setDetectionType(self::DETECTION_TYPE_EXTENDED); - - return $this->matchUAAgainstKey($key); - } - - /** - * Some detection rules are relative (not standard), - * because of the diversity of devices, vendors and - * their conventions in representing the User-Agent or - * the HTTP headers. - * - * This method will be used to check custom regexes against - * the User-Agent string. - * - * @param $regex - * @param string $userAgent - * @return bool - * - * @todo: search in the HTTP headers too. - */ - public function match($regex, $userAgent = null) - { - $match = (bool) preg_match(sprintf('#%s#is', $regex), (false === empty($userAgent) ? $userAgent : $this->userAgent), $matches); - // If positive match is found, store the results for debug. - if ($match) { - $this->matchingRegex = $regex; - $this->matchesArray = $matches; - } - - return $match; - } - - /** - * Get the properties array. - * - * @return array - */ - public static function getProperties() - { - return self::$properties; - } - - /** - * Prepare the version number. - * - * @todo Remove the error supression from str_replace() call. - * - * @param string $ver The string version, like "2.6.21.2152"; - * - * @return float - */ - public function prepareVersionNo($ver) - { - $ver = str_replace(array('_', ' ', '/'), '.', $ver); - $arrVer = explode('.', $ver, 2); - - if (isset($arrVer[1])) { - $arrVer[1] = @str_replace('.', '', $arrVer[1]); // @todo: treat strings versions. - } - - return (float) implode('.', $arrVer); - } - - /** - * Check the version of the given property in the User-Agent. - * Will return a float number. (eg. 2_0 will return 2.0, 4.3.1 will return 4.31) - * - * @param string $propertyName The name of the property. See self::getProperties() array - * keys for all possible properties. - * @param string $type Either self::VERSION_TYPE_STRING to get a string value or - * self::VERSION_TYPE_FLOAT indicating a float value. This parameter - * is optional and defaults to self::VERSION_TYPE_STRING. Passing an - * invalid parameter will default to the this type as well. - * - * @return string|float The version of the property we are trying to extract. - */ - public function version($propertyName, $type = self::VERSION_TYPE_STRING) - { - if (empty($propertyName)) { - return false; - } - - // set the $type to the default if we don't recognize the type - if ($type !== self::VERSION_TYPE_STRING && $type !== self::VERSION_TYPE_FLOAT) { - $type = self::VERSION_TYPE_STRING; - } - - $properties = self::getProperties(); - - // Check if the property exists in the properties array. - if (true === isset($properties[$propertyName])) { - - // Prepare the pattern to be matched. - // Make sure we always deal with an array (string is converted). - $properties[$propertyName] = (array) $properties[$propertyName]; - - foreach ($properties[$propertyName] as $propertyMatchString) { - - $propertyPattern = str_replace('[VER]', self::VER, $propertyMatchString); - - // Identify and extract the version. - preg_match(sprintf('#%s#is', $propertyPattern), $this->userAgent, $match); - - if (false === empty($match[1])) { - $version = ($type == self::VERSION_TYPE_FLOAT ? $this->prepareVersionNo($match[1]) : $match[1]); - - return $version; - } - - } - - } - - return false; - } - - /** - * Retrieve the mobile grading, using self::MOBILE_GRADE_* constants. - * - * @return string One of the self::MOBILE_GRADE_* constants. - */ - public function mobileGrade() - { - $isMobile = $this->isMobile(); - - if ( - // Apple iOS 4-7.0 – Tested on the original iPad (4.3 / 5.0), iPad 2 (4.3 / 5.1 / 6.1), iPad 3 (5.1 / 6.0), iPad Mini (6.1), iPad Retina (7.0), iPhone 3GS (4.3), iPhone 4 (4.3 / 5.1), iPhone 4S (5.1 / 6.0), iPhone 5 (6.0), and iPhone 5S (7.0) - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) >= 4.3 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) >= 4.3 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) >= 4.3 || - - // Android 2.1-2.3 - Tested on the HTC Incredible (2.2), original Droid (2.2), HTC Aria (2.1), Google Nexus S (2.3). Functional on 1.5 & 1.6 but performance may be sluggish, tested on Google G1 (1.5) - // Android 3.1 (Honeycomb) - Tested on the Samsung Galaxy Tab 10.1 and Motorola XOOM - // Android 4.0 (ICS) - Tested on a Galaxy Nexus. Note: transition performance can be poor on upgraded devices - // Android 4.1 (Jelly Bean) - Tested on a Galaxy Nexus and Galaxy 7 - ( $this->version('Android', self::VERSION_TYPE_FLOAT)>2.1 && $this->is('Webkit') ) || - - // Windows Phone 7.5-8 - Tested on the HTC Surround (7.5), HTC Trophy (7.5), LG-E900 (7.5), Nokia 800 (7.8), HTC Mazaa (7.8), Nokia Lumia 520 (8), Nokia Lumia 920 (8), HTC 8x (8) - $this->version('Windows Phone OS', self::VERSION_TYPE_FLOAT) >= 7.5 || - - // Tested on the Torch 9800 (6) and Style 9670 (6), BlackBerry® Torch 9810 (7), BlackBerry Z10 (10) - $this->is('BlackBerry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 6.0 || - // Blackberry Playbook (1.0-2.0) - Tested on PlayBook - $this->match('Playbook.*Tablet') || - - // Palm WebOS (1.4-3.0) - Tested on the Palm Pixi (1.4), Pre (1.4), Pre 2 (2.0), HP TouchPad (3.0) - ( $this->version('webOS', self::VERSION_TYPE_FLOAT) >= 1.4 && $this->match('Palm|Pre|Pixi') ) || - // Palm WebOS 3.0 - Tested on HP TouchPad - $this->match('hp.*TouchPad') || - - // Firefox Mobile 18 - Tested on Android 2.3 and 4.1 devices - ( $this->is('Firefox') && $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 18 ) || - - // Chrome for Android - Tested on Android 4.0, 4.1 device - ( $this->is('Chrome') && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 4.0 ) || - - // Skyfire 4.1 - Tested on Android 2.3 device - ( $this->is('Skyfire') && $this->version('Skyfire', self::VERSION_TYPE_FLOAT) >= 4.1 && $this->is('AndroidOS') && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) || - - // Opera Mobile 11.5-12: Tested on Android 2.3 - ( $this->is('Opera') && $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11.5 && $this->is('AndroidOS') ) || - - // Meego 1.2 - Tested on Nokia 950 and N9 - $this->is('MeeGoOS') || - - // Tizen (pre-release) - Tested on early hardware - $this->is('Tizen') || - - // Samsung Bada 2.0 - Tested on a Samsung Wave 3, Dolphin browser - // @todo: more tests here! - $this->is('Dolfin') && $this->version('Bada', self::VERSION_TYPE_FLOAT) >= 2.0 || - - // UC Browser - Tested on Android 2.3 device - ( ($this->is('UC Browser') || $this->is('Dolfin')) && $this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 ) || - - // Kindle 3 and Fire - Tested on the built-in WebKit browser for each - ( $this->match('Kindle Fire') || - $this->is('Kindle') && $this->version('Kindle', self::VERSION_TYPE_FLOAT) >= 3.0 ) || - - // Nook Color 1.4.1 - Tested on original Nook Color, not Nook Tablet - $this->is('AndroidOS') && $this->is('NookTablet') || - - // Chrome Desktop 16-24 - Tested on OS X 10.7 and Windows 7 - $this->version('Chrome', self::VERSION_TYPE_FLOAT) >= 16 && !$isMobile || - - // Safari Desktop 5-6 - Tested on OS X 10.7 and Windows 7 - $this->version('Safari', self::VERSION_TYPE_FLOAT) >= 5.0 && !$isMobile || - - // Firefox Desktop 10-18 - Tested on OS X 10.7 and Windows 7 - $this->version('Firefox', self::VERSION_TYPE_FLOAT) >= 10.0 && !$isMobile || - - // Internet Explorer 7-9 - Tested on Windows XP, Vista and 7 - $this->version('IE', self::VERSION_TYPE_FLOAT) >= 7.0 && !$isMobile || - - // Opera Desktop 10-12 - Tested on OS X 10.7 and Windows 7 - $this->version('Opera', self::VERSION_TYPE_FLOAT) >= 10 && !$isMobile - ){ - return self::MOBILE_GRADE_A; - } - - if ( - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT)<4.3 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT)<4.3 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT)<4.3 || - - // Blackberry 5.0: Tested on the Storm 2 9550, Bold 9770 - $this->is('Blackberry') && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) >= 5 && $this->version('BlackBerry', self::VERSION_TYPE_FLOAT)<6 || - - //Opera Mini (5.0-6.5) - Tested on iOS 3.2/4.3 and Android 2.3 - ($this->version('Opera Mini', self::VERSION_TYPE_FLOAT) >= 5.0 && $this->version('Opera Mini', self::VERSION_TYPE_FLOAT) <= 7.0 && - ($this->version('Android', self::VERSION_TYPE_FLOAT) >= 2.3 || $this->is('iOS')) ) || - - // Nokia Symbian^3 - Tested on Nokia N8 (Symbian^3), C7 (Symbian^3), also works on N97 (Symbian^1) - $this->match('NokiaN8|NokiaC7|N97.*Series60|Symbian/3') || - - // @todo: report this (tested on Nokia N71) - $this->version('Opera Mobi', self::VERSION_TYPE_FLOAT) >= 11 && $this->is('SymbianOS') - ){ - return self::MOBILE_GRADE_B; - } - - if ( - // Blackberry 4.x - Tested on the Curve 8330 - $this->version('BlackBerry', self::VERSION_TYPE_FLOAT) <= 5.0 || - // Windows Mobile - Tested on the HTC Leo (WinMo 5.2) - $this->match('MSIEMobile|Windows CE.*Mobile') || $this->version('Windows Mobile', self::VERSION_TYPE_FLOAT) <= 5.2 || - - // Tested on original iPhone (3.1), iPhone 3 (3.2) - $this->is('iOS') && $this->version('iPad', self::VERSION_TYPE_FLOAT) <= 3.2 || - $this->is('iOS') && $this->version('iPhone', self::VERSION_TYPE_FLOAT) <= 3.2 || - $this->is('iOS') && $this->version('iPod', self::VERSION_TYPE_FLOAT) <= 3.2 || - - // Internet Explorer 7 and older - Tested on Windows XP - $this->version('IE', self::VERSION_TYPE_FLOAT) <= 7.0 && !$isMobile - ){ - return self::MOBILE_GRADE_C; - } - - // All older smartphone platforms and featurephones - Any device that doesn't support media queries - // will receive the basic, C grade experience. - return self::MOBILE_GRADE_C; - } -} diff --git a/app/vendor/tijsverkoyen/akismet/Akismet.php b/app/vendor/tijsverkoyen/akismet/Akismet.php deleted file mode 100755 index 09085bd..0000000 --- a/app/vendor/tijsverkoyen/akismet/Akismet.php +++ /dev/null @@ -1,526 +0,0 @@ - - * @version 1.1.0 - * @copyright Copyright (c) Tijs Verkoyen. All rights reserved. - * @license BSD License - */ -class Akismet -{ - // internal constant to enable/disable debugging - const DEBUG = false; - - // url for the api - const API_URL = 'http://rest.akismet.com'; - - // port for the api - const API_PORT = 80; - - // version of the api - const API_VERSION = '1.1'; - - // current version - const VERSION = '1.1.0'; - - /** - * The key for the API - * @var string - */ - private $apiKey; - - /** - * The timeout - * @var int - */ - private $timeOut = 60; - - /** - * The user agent - * @var string - */ - private $userAgent; - - /** - * The url - * @var string - */ - private $url; - -// class methods - /** - * Default constructor - * Creates an instance of the Akismet Class. - * - * @param string $apiKey API key being verified for use with the API. - * @param string $url The front page or home URL of the instance making - * the request. For a blog or wiki this would be the - * front page. Note: Must be a full URI, including - * http://. - */ - public function __construct($apiKey, $url) - { - $this->setApiKey($apiKey); - $this->setUrl($url); - } - - /** - * Make the call - * @param string $url URL to call. - * @param array[optional] $aParameters The parameters to pass. - * @param bool[optional] $authenticate Should we authenticate? - * @return string - */ - private function doCall($url, $aParameters = array(), $authenticate = true) - { - // redefine - $url = (string) $url; - $aParameters = (array) $aParameters; - $authenticate = (bool) $authenticate; - - // build url - $url = self::API_URL . '/' . self::API_VERSION . '/' . $url; - - // add key in front of url - if ($authenticate) { - // get api key - $apiKey = $this->getApiKey(); - - // validate apiKey - if ($apiKey == '') throw new Exception('Invalid API-key'); - - // prepend key - $url = str_replace('http://', 'http://' . $apiKey . '.', $url); - } - - // add url into the parameters - $aParameters['blog'] = $this->getUrl(); - - // set options - $options[CURLOPT_URL] = $url; - $options[CURLOPT_PORT] = self::API_PORT; - $options[CURLOPT_USERAGENT] = $this->getUserAgent(); - if (ini_get('open_basedir') == '' && ini_get('safe_mode' == 'Off')) { - $options[CURLOPT_FOLLOWLOCATION] = true; - } - $options[CURLOPT_RETURNTRANSFER] = true; - $options[CURLOPT_TIMEOUT] = (int) $this->getTimeOut(); - $options[CURLOPT_POST] = true; - $options[CURLOPT_POSTFIELDS] = $aParameters; - - // speed up things, use HTTP 1.0 - $options[CURLOPT_HTTP_VERSION] = CURL_HTTP_VERSION_1_0; - - // init - $curl = curl_init(); - - // set options - curl_setopt_array($curl, $options); - - // execute - $response = curl_exec($curl); - $headers = curl_getinfo($curl); - - // fetch errors - $errorNumber = curl_errno($curl); - $errorMessage = curl_error($curl); - - // close - curl_close($curl); - - // invalid headers - if (!in_array($headers['http_code'], array(0, 200))) { - // should we provide debug information - if (self::DEBUG) { - // make it output proper - echo '
';
-
-                // dump the header-information
-                var_dump($headers);
-
-                // dump the raw response
-                var_dump($response);
-
-                // end proper format
-                echo '
'; - - // stop the script - exit(); - } - - // throw error - throw new Exception(null, (int) $headers['http_code']); - } - - // error? - if ($errorNumber != '') throw new Exception($errorMessage, $errorNumber); - - // return - return $response; - } - - /** - * Get the API-key that will be used - * - * @return string - */ - private function getApiKey() - { - return (string) $this->apiKey; - } - - /** - * Get the timeout that will be used - * - * @return int - */ - public function getTimeOut() - { - return (int) $this->timeOut; - } - - /** - * Get the url of the instance making the request - * - * @return string - */ - public function getUrl() - { - return (string) $this->url; - } - - /** - * Get the useragent that will be used. - * Our version will be prepended to yours. It will look like: - * "PHP Akismet/ " - * - * @return string - */ - public function getUserAgent() - { - return (string) 'PHP Akismet/' . self::VERSION . ' ' . $this->userAgent; - } - - /** - * Set API key that has to be used - * - * @param string $apiKey API key to use. - */ - private function setApiKey($apiKey) - { - $this->apiKey = (string) $apiKey; - } - - /** - * Set the timeout - * After this time the request will stop. You should handle any errors - * triggered by this. - * - * @param int $seconds The timeout in seconds. - */ - public function setTimeOut($seconds) - { - $this->timeOut = (int) $seconds; - } - - /** - * Set the url of the instance making the request - * @param string $url The URL making the request. - */ - private function setUrl($url) - { - $this->url = (string) $url; - } - - /** - * Set the user-agent for you application - * It will be appended to ours, the result will look like: - * "PHP Akismet/ " - * - * @param string $userAgent The user-agent, it should look like: - * /. - */ - public function setUserAgent($userAgent) - { - $this->userAgent = (string) $userAgent; - } - - // api methods - /** - * Verifies the key - * @return bool if the key is valid it will return true, otherwise false - * will be returned. - */ - public function verifyKey() - { - // possible answers - $aPossibleResponses = array('valid', 'invalid'); - - // build parameters - $aParameters['key'] = $this->getApiKey(); - - // make the call - $response = $this->doCall('verify-key', $aParameters, false); - - // validate response - if (!in_array($response, $aPossibleResponses)) { - throw new Exception($response, 400); - } - - // valid key - if ($response == 'valid') return true; - - // fallback - return false; - } - - /** - * Check if the comment is spam or not - * This is basically the core of everything. This call takes a number of - * arguments and characteristics about the submitted content and then - * returns a thumbs up or thumbs down. - * Almost everything is optional, but performance can drop dramatically if - * you exclude certain elements. - * REMARK: If you are having trouble triggering you can send - * "viagra-test-123" as the author and it will trigger a true response, - * always. - * - * @param string[optional] $content The content that was submitted. - * @param string[optional] $author The name. - * @param string[optional] $email The email address. - * @param string[optional] $url The URL. - * @param string[optional] $permalink The permanent location of the entry - * the comment was submitted to. - * @param string[optional] $type The type, can be blank, comment, - * trackback, pingback, or a made up - * value like "registration". - * @return bool If the comment is spam true will be - * returned, otherwise false. - */ - public function isSpam( - $content, - $author = null, - $email = null, - $url = null, - $permalink = null, - $type = null - ) - { - // possible answers - $aPossibleResponses = array('true', 'false'); - - // redefine - $content = (string) $content; - $author = (string) $author; - $email = (string) $email; - $url = (string) $url; - $permalink = (string) $permalink; - $type = (string) $type; - - // get stuff from the $_SERVER-array - if (isset($_SERVER['HTTP_X_FORWARDED_FOR'])) { - $ip = $_SERVER['HTTP_X_FORWARDED_FOR']; - } elseif (isset($_SERVER['REMOTE_ADDR'])) { - $ip = $_SERVER['REMOTE_ADDR']; - } else $ip = ''; - if (isset($_SERVER['HTTP_USER_AGENT'])) { - $userAgent = (string) $_SERVER['HTTP_USER_AGENT']; - } else $userAgent = ''; - if (isset($_SERVER['HTTP_REFERER'])) { - $referrer = (string) $_SERVER['HTTP_REFERER']; - } else $referrer = ''; - - // build parameters - $aParameters['user_ip'] = $ip; - $aParameters['user_agent'] = $userAgent; - if ($referrer != '') $aParameters['referrer'] = $referrer; - if ($permalink != '') $aParameters['permalink'] = $permalink; - if ($type != '') $aParameters['comment_type'] = $type; - if ($author != '') $aParameters['comment_author'] = $author; - if ($email != '') $aParameters['comment_author_email'] = $email; - if ($url != '') $aParameters['comment_author_url'] = $url; - $aParameters['comment_content'] = $content; - - // add all stuff from $_SERVER - foreach ($_SERVER as $key => $value) { - // keys to ignore - $aKeysToIgnore = array( - 'HTTP_COOKIE', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED_HOST', - 'HTTP_MAX_FORWARDS', 'HTTP_X_FORWARDED_SERVER', - 'REDIRECT_STATUS', 'SERVER_PORT', 'PATH', 'DOCUMENT_ROOT', - 'SERVER_ADMIN', 'QUERY_STRING', 'PHP_SELF', 'argv', 'argc', - 'SCRIPT_FILENAME', 'SCRIPT_NAME' - ); - - // add to parameters if not in ignore list - if (!in_array($key, $aKeysToIgnore)) $aParameters[$key] = $value; - } - - // make the call - $response = $this->doCall('comment-check', $aParameters); - - // validate response - if (!in_array($response, $aPossibleResponses)) { - throw new Exception($response, 400); - } - - // process response - if ($response == 'true') return true; - - // fallback - return false; - } - - /** - * Submit ham to Akismet - * This call is intended for the marking of false positives, things that - * were incorrectly marked as spam. - * @param string $userIp The address of the comment submitter. - * @param string $userAgent The agent information. - * @param string[optional] $content The content that was submitted. - * @param string[optional] $author The name of the author. - * @param string[optional] $email The email address. - * @param string[optional] $url The URL. - * @param string[optional] $permalink The permanent location of the entry - * the comment was submitted to. - * @param string[optional] $type The type, can be blank, comment, - * trackback, pingback, or a made up - * value like "registration". - * @param string[optional] $referrer The content of the HTTP_REFERER - * header should be sent here. - * @param array[optional] $others Extra data (the variables from - * $_SERVER). - * @return bool If everything went fine true will be - * returned, otherwise an exception - * will be triggered. - */ - public function submitHam( - $userIp, - $userAgent, - $content, - $author = null, - $email = null, - $url = null, - $permalink = null, - $type = null, - $referrer = null, - $others = null - ) - { - // possible answers - $aPossibleResponses = array('Thanks for making the web a better place.'); - - // redefine - $userIp = (string) $userIp; - $userAgent = (string) $userAgent; - $content = (string) $content; - $author = (string) $author; - $email = (string) $email; - $url = (string) $url; - $permalink = (string) $permalink; - $type = (string) $type; - $referrer = (string) $referrer; - $others = (array) $others; - - // build parameters - $aParameters['user_ip'] = $userIp; - $aParameters['user_agent'] = $userAgent; - if ($referrer != '') $aParameters['referrer'] = $referrer; - if ($permalink != '') $aParameters['permalink'] = $permalink; - if ($type != '') $aParameters['comment_type'] = $type; - if ($author != '') $aParameters['comment_author'] = $author; - if ($email != '') $aParameters['comment_author_email'] = $email; - if ($url != '') $aParameters['comment_author_url'] = $url; - $aParameters['comment_content'] = $content; - - // add other parameters - foreach ($others as $key => $value) $aParameters[$key] = $value; - - // make the call - $response = $this->doCall('submit-ham', $aParameters); - - // validate response - if (in_array($response, $aPossibleResponses)) return true; - - // fallback - throw new Exception($response); - } - - /** - * Submit spam to Akismet - * This call is for submitting comments that weren't marked as spam but - * should have been. - * @param string $userIp The address of the comment submitter. - * @param string $userAgent The agent information. - * @param string[optional] $content The content that was submitted. - * @param string[optional] $author The name of the author. - * @param string[optional] $email The email address. - * @param string[optional] $url The URL. - * @param string[optional] $permalink The permanent location of the entry - * the comment was submitted to. - * @param string[optional] $type The type, can be blank, comment, - * trackback, pingback, or a made up - * value like "registration". - * @param string[optional] $referrer The content of the HTTP_REFERER - * header should be sent here. - * @param array[optional] $others Extra data (the variables from - * $_SERVER). - * @return bool If everything went fine true will be - * returned, otherwise an exception - * will be triggered. - */ - public function submitSpam( - $userIp, - $userAgent, - $content, - $author = null, - $email = null, - $url = null, - $permalink = null, - $type = null, - $referrer = null, - $others = null - ) - { - // possible answers - $aPossibleResponses = array('Thanks for making the web a better place.'); - - // redefine - $userIp = (string) $userIp; - $userAgent = (string) $userAgent; - $content = (string) $content; - $author = (string) $author; - $email = (string) $email; - $url = (string) $url; - $permalink = (string) $permalink; - $type = (string) $type; - $referrer = (string) $referrer; - $others = (array) $others; - - // build parameters - $aParameters['user_ip'] = $userIp; - $aParameters['user_agent'] = $userAgent; - if ($referrer != '') $aParameters['referrer'] = $referrer; - if ($permalink != '') $aParameters['permalink'] = $permalink; - if ($type != '') $aParameters['comment_type'] = $type; - if ($author != '') $aParameters['comment_author'] = $author; - if ($email != '') $aParameters['comment_author_email'] = $email; - if ($url != '') $aParameters['comment_author_url'] = $url; - $aParameters['comment_content'] = $content; - - // add other parameters - foreach ($others as $key => $value) $aParameters[$key] = $value; - - // make the call - $response = $this->doCall('submit-spam', $aParameters); - - // validate response - if (in_array($response, $aPossibleResponses)) return true; - - // fallback - throw new Exception($response); - } -} diff --git a/app/vendor/tijsverkoyen/akismet/Exception.php b/app/vendor/tijsverkoyen/akismet/Exception.php deleted file mode 100644 index 09664e4..0000000 --- a/app/vendor/tijsverkoyen/akismet/Exception.php +++ /dev/null @@ -1,77 +0,0 @@ - - */ -class Exception extends \Exception -{ - /** - * Http header-codes - * - * @var array - */ - private $aStatusCodes = array( - 100 => 'Continue', - 101 => 'Switching Protocols', - 200 => 'OK', - 201 => 'Created', - 202 => 'Accepted', - 203 => 'Non-Authoritative Information', - 204 => 'No Content', - 205 => 'Reset Content', - 206 => 'Partial Content', - 300 => 'Multiple Choices', - 301 => 'Moved Permanently', - 301 => 'Status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.', - 302 => 'Found', - 302 => 'Status code is received in response to a request other than GET or HEAD, the user agent MUST NOT automatically redirect the request unless it can be confirmed by the user, since this might change the conditions under which the request was issued.', - 303 => 'See Other', - 304 => 'Not Modified', - 305 => 'Use Proxy', - 306 => '(Unused)', - 307 => 'Temporary Redirect', - 400 => 'Bad Request', - 401 => 'Unauthorized', - 402 => 'Payment Required', - 403 => 'Forbidden', - 404 => 'Not Found', - 405 => 'Method Not Allowed', - 406 => 'Not Acceptable', - 407 => 'Proxy Authentication Required', - 408 => 'Request Timeout', - 409 => 'Conflict', - 411 => 'Length Required', - 412 => 'Precondition Failed', - 413 => 'Request Entity Too Large', - 414 => 'Request-URI Too Long', - 415 => 'Unsupported Media Type', - 416 => 'Requested Range Not Satisfiable', - 417 => 'Expectation Failed', - 500 => 'Internal Server Error', - 501 => 'Not Implemented', - 502 => 'Bad Gateway', - 503 => 'Service Unavailable', - 504 => 'Gateway Timeout', - 505 => 'HTTP Version Not Supported' - ); - - /** - * Default constructor - * - * @param $message string[optional] message. - * @param $code int[optional] error number. - */ - public function __construct($message = null, $code = null) - { - // set message - if ($message === null && isset($this->aStatusCodes[(int) $code])) { - $message = $this->aStatusCodes[(int) $code]; - } - - // call parent - parent::__construct((string) $message, $code); - } -} diff --git a/app/vendor/tijsverkoyen/akismet/LICENSE.md b/app/vendor/tijsverkoyen/akismet/LICENSE.md deleted file mode 100644 index 7845368..0000000 --- a/app/vendor/tijsverkoyen/akismet/LICENSE.md +++ /dev/null @@ -1,22 +0,0 @@ -Copyright (c) Tijs Verkoyen. All rights reserved. -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - -1. Redistributions of source code must retain the above copyright notice, this - list of conditions and the following disclaimer. -2. Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. -3. The name of the author may not be used to endorse or promote products - derived from this software without specific prior written permission. - -This software is provided by the author "as is" and any express or implied -warranties, including, but not limited to, the implied warranties of -merchantability and fitness for a particular purpose are disclaimed. In no event -shall the author be liable for any direct, indirect, incidental, special, -exemplary, or consequential damages (including, but not limited to, procurement -of substitute goods or services; loss of use, data, or profits; or business -interruption) however caused and on any theory of liability, whether in -contract, strict liability, or tort (including negligence or otherwise) arising -in any way out of the use of this software, even if advised of the possibility -of such damage. \ No newline at end of file diff --git a/app/vendor/tijsverkoyen/akismet/composer.json b/app/vendor/tijsverkoyen/akismet/composer.json deleted file mode 100644 index eeff882..0000000 --- a/app/vendor/tijsverkoyen/akismet/composer.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "name": "tijsverkoyen/akismet", - "type": "library", - "description": "Akismet is a wrapper-class to communicate with the Akismet API.", - "homepage": "https://github.com/tijsverkoyen/Akismet", - "license": "BSD", - "authors": [ - { - "name": "Tijs Verkoyen", - "email": "akismet@verkoyen.eu", - "role": "Developer" - } - ], - "require": { - "php": ">=5.2.0", - "ext-curl": "*" - }, - "autoload": { - "classmap": [""] - } -} \ No newline at end of file