01tonythomas has uploaded a new change for review.
https://gerrit.wikimedia.org/r/170369
Change subject: Added the Plancake e-mail parser library to MediaWiki using
Composer
......................................................................
Added the Plancake e-mail parser library to MediaWiki using Composer
The library was included earlier in BounceHandler/vendor/ but this seems to be
the
right place to add the additional dependency.
Bug: 69019
Change-Id: I5cc3d2eda7188628fd016950a16ffe63c2ae6f6f
---
M composer.json
M composer.lock
M composer/autoload_classmap.php
M composer/autoload_namespaces.php
M composer/installed.json
A floriansemm/official-library-php-email-parser/LICENSE.txt
A floriansemm/official-library-php-email-parser/PlancakeEmailParser.php
A floriansemm/official-library-php-email-parser/README.txt
A floriansemm/official-library-php-email-parser/composer.json
A floriansemm/official-library-php-email-parser/tests/emails/0.txt
A floriansemm/official-library-php-email-parser/tests/emails/1.txt
A floriansemm/official-library-php-email-parser/tests/emails/2.txt
A
floriansemm/official-library-php-email-parser/tests/emails/from_ipad_with_attachment.txt
A
floriansemm/official-library-php-email-parser/tests/emails/subject_on_multiple_lines.txt
A floriansemm/official-library-php-email-parser/tests/run_tests.php
15 files changed, 1,010 insertions(+), 6 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/vendor
refs/changes/69/170369/1
diff --git a/composer.json b/composer.json
index b38bc95..90bb76c 100644
--- a/composer.json
+++ b/composer.json
@@ -6,7 +6,8 @@
"require": {
"php": ">=5.3.3",
"psr/log": "1.0.0",
- "monolog/monolog": "1.9.1"
+ "monolog/monolog": "1.9.1",
+ "floriansemm/official-library-php-email-parser": "dev-master"
},
"prefer-stable": true,
"config": {
diff --git a/composer.lock b/composer.lock
index cb1b605..6106d6a 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,8 +4,49 @@
"Read more about it at
http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "7e1b3e3318fa0947bccca95fac144cc7",
+ "hash": "a8d09858039c1de8cca89af6af8de17d",
"packages": [
+ {
+ "name": "floriansemm/official-library-php-email-parser",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url":
"https://github.com/floriansemm/official-library-php-email-parser.git",
+ "reference": "e7453ead1f3a74810d8050a30afb96feed74477a"
+ },
+ "dist": {
+ "type": "zip",
+ "url":
"https://api.github.com/repos/floriansemm/official-library-php-email-parser/zipball/e7453ead1f3a74810d8050a30afb96feed74477a",
+ "reference": "e7453ead1f3a74810d8050a30afb96feed74477a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "PlancakeEmailParser": "."
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPLv3"
+ ],
+ "authors": [
+ {
+ "name": "Daniele Occhipinti",
+ "email": "[email protected]"
+ }
+ ],
+ "description": "Plancake Email Parser is a simple emailparser for
php",
+ "homepage": "http://www.plancake.com",
+ "keywords": [
+ "email",
+ "parser"
+ ],
+ "time": "2014-04-28 12:24:59"
+ },
{
"name": "monolog/monolog",
"version": "1.9.1",
@@ -113,13 +154,21 @@
"time": "2012-12-21 11:40:51"
}
],
- "packages-dev": [],
- "aliases": [],
+ "packages-dev": [
+
+ ],
+ "aliases": [
+
+ ],
"minimum-stability": "stable",
- "stability-flags": [],
+ "stability-flags": {
+ "floriansemm/official-library-php-email-parser": 20
+ },
"prefer-stable": true,
"platform": {
"php": ">=5.3.3"
},
- "platform-dev": []
+ "platform-dev": [
+
+ ]
}
diff --git a/composer/autoload_classmap.php b/composer/autoload_classmap.php
index 8362043..515ba5a 100644
--- a/composer/autoload_classmap.php
+++ b/composer/autoload_classmap.php
@@ -77,6 +77,7 @@
'Monolog\\Processor\\UidProcessor' => $vendorDir .
'/monolog/monolog/src/Monolog/Processor/UidProcessor.php',
'Monolog\\Processor\\WebProcessor' => $vendorDir .
'/monolog/monolog/src/Monolog/Processor/WebProcessor.php',
'Monolog\\Registry' => $vendorDir .
'/monolog/monolog/src/Monolog/Registry.php',
+ 'PlancakeEmailParser' => $vendorDir .
'/floriansemm/official-library-php-email-parser/PlancakeEmailParser.php',
'Psr\\Log\\AbstractLogger' => $vendorDir .
'/psr/log/Psr/Log/AbstractLogger.php',
'Psr\\Log\\InvalidArgumentException' => $vendorDir .
'/psr/log/Psr/Log/InvalidArgumentException.php',
'Psr\\Log\\LogLevel' => $vendorDir . '/psr/log/Psr/Log/LogLevel.php',
diff --git a/composer/autoload_namespaces.php b/composer/autoload_namespaces.php
index 9ebc80b..7b1e7b8 100644
--- a/composer/autoload_namespaces.php
+++ b/composer/autoload_namespaces.php
@@ -7,4 +7,5 @@
return array(
'Psr\\Log\\' => array($vendorDir . '/psr/log'),
+ 'PlancakeEmailParser' => array($vendorDir .
'/floriansemm/official-library-php-email-parser'),
);
diff --git a/composer/installed.json b/composer/installed.json
index 681762f..157e2cb 100644
--- a/composer/installed.json
+++ b/composer/installed.json
@@ -108,5 +108,48 @@
"logging",
"psr-3"
]
+ },
+ {
+ "name": "floriansemm/official-library-php-email-parser",
+ "version": "dev-master",
+ "version_normalized": "9999999-dev",
+ "source": {
+ "type": "git",
+ "url":
"https://github.com/floriansemm/official-library-php-email-parser.git",
+ "reference": "e7453ead1f3a74810d8050a30afb96feed74477a"
+ },
+ "dist": {
+ "type": "zip",
+ "url":
"https://api.github.com/repos/floriansemm/official-library-php-email-parser/zipball/e7453ead1f3a74810d8050a30afb96feed74477a",
+ "reference": "e7453ead1f3a74810d8050a30afb96feed74477a",
+ "shasum": ""
+ },
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "time": "2014-04-28 12:24:59",
+ "type": "library",
+ "installation-source": "dist",
+ "autoload": {
+ "psr-0": {
+ "PlancakeEmailParser": "."
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "GPLv3"
+ ],
+ "authors": [
+ {
+ "name": "Daniele Occhipinti",
+ "email": "[email protected]"
+ }
+ ],
+ "description": "Plancake Email Parser is a simple emailparser for php",
+ "homepage": "http://www.plancake.com",
+ "keywords": [
+ "email",
+ "parser"
+ ]
}
]
diff --git a/floriansemm/official-library-php-email-parser/LICENSE.txt
b/floriansemm/official-library-php-email-parser/LICENSE.txt
new file mode 100644
index 0000000..65c5ca8
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/LICENSE.txt
@@ -0,0 +1,165 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 3, 29 June 2007
+
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+
+ This version of the GNU Lesser General Public License incorporates
+the terms and conditions of version 3 of the GNU General Public
+License, supplemented by the additional permissions listed below.
+
+ 0. Additional Definitions.
+
+ As used herein, "this License" refers to version 3 of the GNU Lesser
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
+General Public License.
+
+ "The Library" refers to a covered work governed by this License,
+other than an Application or a Combined Work as defined below.
+
+ An "Application" is any work that makes use of an interface provided
+by the Library, but which is not otherwise based on the Library.
+Defining a subclass of a class defined by the Library is deemed a mode
+of using an interface provided by the Library.
+
+ A "Combined Work" is a work produced by combining or linking an
+Application with the Library. The particular version of the Library
+with which the Combined Work was made is also called the "Linked
+Version".
+
+ The "Minimal Corresponding Source" for a Combined Work means the
+Corresponding Source for the Combined Work, excluding any source code
+for portions of the Combined Work that, considered in isolation, are
+based on the Application, and not on the Linked Version.
+
+ The "Corresponding Application Code" for a Combined Work means the
+object code and/or source code for the Application, including any data
+and utility programs needed for reproducing the Combined Work from the
+Application, but excluding the System Libraries of the Combined Work.
+
+ 1. Exception to Section 3 of the GNU GPL.
+
+ You may convey a covered work under sections 3 and 4 of this License
+without being bound by section 3 of the GNU GPL.
+
+ 2. Conveying Modified Versions.
+
+ If you modify a copy of the Library, and, in your modifications, a
+facility refers to a function or data to be supplied by an Application
+that uses the facility (other than as an argument passed when the
+facility is invoked), then you may convey a copy of the modified
+version:
+
+ a) under this License, provided that you make a good faith effort to
+ ensure that, in the event an Application does not supply the
+ function or data, the facility still operates, and performs
+ whatever part of its purpose remains meaningful, or
+
+ b) under the GNU GPL, with none of the additional permissions of
+ this License applicable to that copy.
+
+ 3. Object Code Incorporating Material from Library Header Files.
+
+ The object code form of an Application may incorporate material from
+a header file that is part of the Library. You may convey such object
+code under terms of your choice, provided that, if the incorporated
+material is not limited to numerical parameters, data structure
+layouts and accessors, or small macros, inline functions and templates
+(ten or fewer lines in length), you do both of the following:
+
+ a) Give prominent notice with each copy of the object code that the
+ Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the object code with a copy of the GNU GPL and this license
+ document.
+
+ 4. Combined Works.
+
+ You may convey a Combined Work under terms of your choice that,
+taken together, effectively do not restrict modification of the
+portions of the Library contained in the Combined Work and reverse
+engineering for debugging such modifications, if you also do each of
+the following:
+
+ a) Give prominent notice with each copy of the Combined Work that
+ the Library is used in it and that the Library and its use are
+ covered by this License.
+
+ b) Accompany the Combined Work with a copy of the GNU GPL and this license
+ document.
+
+ c) For a Combined Work that displays copyright notices during
+ execution, include the copyright notice for the Library among
+ these notices, as well as a reference directing the user to the
+ copies of the GNU GPL and this license document.
+
+ d) Do one of the following:
+
+ 0) Convey the Minimal Corresponding Source under the terms of this
+ License, and the Corresponding Application Code in a form
+ suitable for, and under terms that permit, the user to
+ recombine or relink the Application with a modified version of
+ the Linked Version to produce a modified Combined Work, in the
+ manner specified by section 6 of the GNU GPL for conveying
+ Corresponding Source.
+
+ 1) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (a) uses at run time
+ a copy of the Library already present on the user's computer
+ system, and (b) will operate properly with a modified version
+ of the Library that is interface-compatible with the Linked
+ Version.
+
+ e) Provide Installation Information, but only if you would otherwise
+ be required to provide such information under section 6 of the
+ GNU GPL, and only to the extent that such information is
+ necessary to install and execute a modified version of the
+ Combined Work produced by recombining or relinking the
+ Application with a modified version of the Linked Version. (If
+ you use option 4d0, the Installation Information must accompany
+ the Minimal Corresponding Source and Corresponding Application
+ Code. If you use option 4d1, you must provide the Installation
+ Information in the manner specified by section 6 of the GNU GPL
+ for conveying Corresponding Source.)
+
+ 5. Combined Libraries.
+
+ 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 that are not Applications and are not covered by this
+License, and convey such a combined library under terms of your
+choice, if you do both of the following:
+
+ a) Accompany the combined library with a copy of the same work based
+ on the Library, uncombined with any other library facilities,
+ conveyed under the terms of this License.
+
+ b) Give prominent notice with the combined library that part of it
+ is a work based on the Library, and explaining where to find the
+ accompanying uncombined form of the same work.
+
+ 6. Revised Versions of the GNU Lesser General Public License.
+
+ The Free Software Foundation may publish revised and/or new versions
+of the GNU 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 as you received it specifies that a certain numbered version
+of the GNU Lesser General Public License "or any later version"
+applies to it, you have the option of following the terms and
+conditions either of that published version or of any later version
+published by the Free Software Foundation. If the Library as you
+received it does not specify a version number of the GNU Lesser
+General Public License, you may choose any version of the GNU Lesser
+General Public License ever published by the Free Software Foundation.
+
+ If the Library as you received it specifies that a proxy can decide
+whether future versions of the GNU Lesser General Public License shall
+apply, that proxy's public statement of acceptance of any version is
+permanent authorization for you to choose that version for the
+Library.
diff --git
a/floriansemm/official-library-php-email-parser/PlancakeEmailParser.php
b/floriansemm/official-library-php-email-parser/PlancakeEmailParser.php
new file mode 100644
index 0000000..59e6cee
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/PlancakeEmailParser.php
@@ -0,0 +1,338 @@
+<?php
+
+/*************************************************************************************
+*
===================================================================================*
+* Software by: Danyuki Software Limited
*
+* This file is part of Plancake.
*
+*
*
+* Copyright 2009-2010-2011 by: Danyuki Software Limited
*
+* Support, News, Updates at: http://www.plancake.com
*
+* Licensed under the LGPL version 3 license.
* *
+* Danyuki Software Limited is registered in England and Wales (Company No.
07554549) *
+**************************************************************************************
+* Plancake 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 v3.0 for more details.
*
+*
*
+* You should have received a copy of the GNU Lesser General Public License
*
+* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
+*
*
+**************************************************************************************
+*
+* Valuable contributions by:
+* - Chris
+*
+*
**************************************************************************************/
+
+/**
+ * Extracts the headers and the body of an email
+ * Obviously it can't extract the bcc header because it doesn't appear in the
content
+ * of the email.
+ *
+ * N.B.: if you deal with non-English languages, we recommend you install the
IMAP PHP extension:
+ * the Plancake PHP Email Parser will detect it and used it automatically for
better results.
+ *
+ * For more info, check:
+ * https://github.com/plancake/official-library-php-email-parser
+ *
+ * @author dan
+ */
+class PlancakeEmailParser {
+
+ const PLAINTEXT = 1;
+ const HTML = 2;
+
+ /**
+ *
+ * @var boolean
+ */
+ private $isImapExtensionAvailable = false;
+
+ /**
+ *
+ * @var string
+ */
+ private $emailRawContent;
+
+ /**
+ *
+ * @var associative array
+ */
+ protected $rawFields;
+
+ /**
+ *
+ * @var array of string (each element is a line)
+ */
+ protected $rawBodyLines;
+
+ /**
+ *
+ * @param string $emailRawContent
+ */
+ public function __construct($emailRawContent) {
+ $this->emailRawContent = $emailRawContent;
+
+ $this->extractHeadersAndRawBody();
+
+ if (function_exists('imap_open')) {
+ $this->isImapExtensionAvailable = true;
+ }
+ }
+
+ private function extractHeadersAndRawBody()
+ {
+ $lines = preg_split("/(\r?\n|\r)/", $this->emailRawContent);
+
+ $currentHeader = '';
+
+ $i = 0;
+ foreach ($lines as $line)
+ {
+ if(self::isNewLine($line))
+ {
+ // end of headers
+ $this->rawBodyLines = array_slice($lines, $i);
+ break;
+ }
+
+ if ($this->isLineStartingWithPrintableChar($line)) // start of new
header
+ {
+ preg_match('/([^:]+): ?(.*)$/', $line, $matches);
+ $newHeader = strtolower($matches[1]);
+ $value = $matches[2];
+ $this->rawFields[$newHeader] = $value;
+ $currentHeader = $newHeader;
+ }
+ else // more lines related to the current header
+ {
+ if ($currentHeader) { // to prevent notice from empty lines
+ $this->rawFields[$currentHeader] .= substr($line, 1);
+ }
+ }
+ $i++;
+ }
+ }
+
+ /**
+ *
+ * @return string (in UTF-8 format)
+ * @throws Exception if a subject header is not found
+ */
+ public function getSubject()
+ {
+ if (!isset($this->rawFields['subject']))
+ {
+ throw new Exception("Couldn't find the subject of the email");
+ }
+
+ $ret = '';
+
+ if ($this->isImapExtensionAvailable) {
+ foreach (imap_mime_header_decode($this->rawFields['subject']) as
$h) { // subject can span into several lines
+ $charset = ($h->charset == 'default') ? 'US-ASCII' :
$h->charset;
+ $ret .= iconv($charset, "UTF-8//TRANSLIT", $h->text);
+ }
+ } else {
+ $ret = utf8_encode(iconv_mime_decode($this->rawFields['subject']));
+ }
+
+ return $ret;
+ }
+
+ /**
+ *
+ * @return array
+ */
+ public function getCc()
+ {
+ if (!isset($this->rawFields['cc']))
+ {
+ return array();
+ }
+
+ return explode(',', $this->rawFields['cc']);
+ }
+
+ /**
+ *
+ * @return array
+ * @throws Exception if a to header is not found or if there are no
recipient
+ */
+ public function getTo()
+ {
+ if ( (!isset($this->rawFields['to'])) ||
(!count($this->rawFields['to'])))
+ {
+ throw new Exception("Couldn't find the recipients of the email");
+ }
+ return explode(',', $this->rawFields['to']);
+ }
+
+ /**
+ * return string - UTF8 encoded
+ *
+ * Example of an email body
+ *
+ --0016e65b5ec22721580487cb20fd
+ Content-Type: text/plain; charset=ISO-8859-1
+
+ Hi all. I am new to Android development.
+ Please help me.
+
+ --
+ My signature
+
+ email: [email protected]
+ web: http://www.example.com
+
+ --0016e65b5ec22721580487cb20fd
+ Content-Type: text/html; charset=ISO-8859-1
+ */
+ public function getBody($returnType=self::PLAINTEXT)
+ {
+ $body = '';
+ $detectedContentType = false;
+ $contentTransferEncoding = null;
+ $charset = 'ASCII';
+ $waitingForContentStart = true;
+
+ if ($returnType == self::HTML)
+ $contentTypeRegex = '/^Content-Type: ?text\/html/i';
+ else
+ $contentTypeRegex = '/^Content-Type: ?text\/plain/i';
+
+ // there could be more than one boundary
+ preg_match_all('!boundary=(.*)$!mi', $this->emailRawContent, $matches);
+ $boundaries = $matches[1];
+ // sometimes boundaries are delimited by quotes - we want to remove
them
+ foreach($boundaries as $i => $v) {
+ $boundaries[$i] = str_replace(array("'", '"'), '', $v);
+ }
+
+ foreach ($this->rawBodyLines as $line) {
+ if (!$detectedContentType) {
+
+ if (preg_match($contentTypeRegex, $line, $matches)) {
+ $detectedContentType = true;
+ }
+
+ if(preg_match('/charset=(.*)/i', $line, $matches)) {
+ $charset = strtoupper(trim($matches[1], '"'));
+ }
+
+ } else if ($detectedContentType && $waitingForContentStart) {
+
+ if(preg_match('/charset=(.*)/i', $line, $matches)) {
+ $charset = strtoupper(trim($matches[1], '"'));
+ }
+
+ if ($contentTransferEncoding == null &&
preg_match('/^Content-Transfer-Encoding: ?(.*)/i', $line, $matches)) {
+ $contentTransferEncoding = $matches[1];
+ }
+
+ if (self::isNewLine($line)) {
+ $waitingForContentStart = false;
+ }
+ } else { // ($detectedContentType && !$waitingForContentStart)
+ // collecting the actual content until we find the delimiter
+
+ // if the delimited is AAAAA, the line will be --AAAAA -
that's why we use substr
+ if (is_array($boundaries)) {
+ if (in_array(substr($line, 2), $boundaries)) { // found
the delimiter
+ break;
+ }
+ }
+ $body .= $line . "\n";
+ }
+ }
+
+ if (!$detectedContentType)
+ {
+ // if here, we missed the text/plain content-type (probably it was
+ // in the header), thus we assume the whole body is what we are
after
+ $body = implode("\n", $this->rawBodyLines);
+ }
+
+ // removing trailing new lines
+ $body = preg_replace('/((\r?\n)*)$/', '', $body);
+
+ if ($contentTransferEncoding == 'base64')
+ $body = base64_decode($body);
+ else if ($contentTransferEncoding == 'quoted-printable')
+ $body = quoted_printable_decode($body);
+
+ if($charset != 'UTF-8') {
+ // FORMAT=FLOWED, despite being popular in emails, it is not
+ // supported by iconv
+ $charset = str_replace("FORMAT=FLOWED", "", $charset);
+
+ $bodyCopy = $body;
+ $body = iconv($charset, 'UTF-8//TRANSLIT', $body);
+
+ if ($body === FALSE) { // iconv returns FALSE on failure
+ $body = utf8_encode($bodyCopy);
+ }
+ }
+
+ return $body;
+ }
+
+ /**
+ * @return string - UTF8 encoded
+ *
+ */
+ public function getPlainBody()
+ {
+ return $this->getBody(self::PLAINTEXT);
+ }
+
+ /**
+ * return string - UTF8 encoded
+ */
+ public function getHTMLBody()
+ {
+ return $this->getBody(self::HTML);
+ }
+
+ /**
+ * N.B.: if the header doesn't exist an empty string is returned
+ *
+ * @param string $headerName - the header we want to retrieve
+ * @return string - the value of the header
+ */
+ public function getHeader($headerName)
+ {
+ $headerName = strtolower($headerName);
+
+ if (isset($this->rawFields[$headerName]))
+ {
+ return $this->rawFields[$headerName];
+ }
+ return '';
+ }
+
+ /**
+ *
+ * @param string $line
+ * @return boolean
+ */
+ public static function isNewLine($line)
+ {
+ $line = str_replace("\r", '', $line);
+ $line = str_replace("\n", '', $line);
+
+ return (strlen($line) === 0);
+ }
+
+ /**
+ *
+ * @param string $line
+ * @return boolean
+ */
+ private function isLineStartingWithPrintableChar($line)
+ {
+ return preg_match('/^[A-Za-z]/', $line);
+ }
+}
+?>
diff --git a/floriansemm/official-library-php-email-parser/README.txt
b/floriansemm/official-library-php-email-parser/README.txt
new file mode 100644
index 0000000..7776202
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/README.txt
@@ -0,0 +1,57 @@
+*** PLANCAKE PHP EMAIL PARSER ***
+
+N.B.: if you deal with non-English languages, we recommend you install the
IMAP PHP extension:
+the Plancake PHP Email Parser will detect it and used it automatically for
better results.
+
+This library allows you to easily parse an email given its content (headers +
body).
+
+Usage example:
+
+
+$emailPath = "/var/mail/spool/dan/new/12323344323234234234";
+$emailParser = new PlancakeEmailParser(file_get_contents($emailPath));
+
+// You can use some predefined methods to retrieve headers...
+$emailTo = $emailParser->getTo();
+$emailSubject = $emailParser->getSubject();
+$emailCc = $emailParser->getCc();
+// ... or you can use the 'general purpose' method getHeader()
+$emailDeliveredToHeader = $emailParser->getHeader('Delivered-To');
+
+$emailBody = $emailParser->getPlainBody();
+
+For more info:
+https://github.com/plancake/official-library-php-email-parser
+
+-----------------------------------------
+
+We love to hear from you ♥. Please, send us any feedback.
+Even if you don't speak English, don't worry, use your native language (we
have great confidence in Google Translate :-))
+http://www.plancake.com/contact
+
+Please contact us if you need any commercial support with the installation of
any component or if you would like any customization:
+http://www.plancake.com/contact
+
+Please consider contributing with bug fixes or improvements:
[email protected]
+
+Plancake homepage: http://www.plancake.com
+Support: http://www.plancake.com/forums/forum/13/support-for-developers/
+Subscribe to our blog: http://www.plancake.com/blog
+Follow us on Twitter: http://twitter.com/plancakebakers
+Follow us on Facebook: http://www.facebook.com/plancake
+Donations ♥ : http://www.plancake.com/donate
+
+"Plancake" and "Plancake Team" are trademarks of Daniele Occhipinti.
+(by the way, what about using Plancake Team for team collaboration?
team.plancake.com)
+
+Brought to you by Danyuki Software Limited, a startup tech company based in
London, UK.
+
+
+
+Happy plancaking!
+
+Daniele Occhipinti
+Director and Founder of Plancake
+email: [email protected]
+skype: dan_plan (I can speak English and Italian)
diff --git a/floriansemm/official-library-php-email-parser/composer.json
b/floriansemm/official-library-php-email-parser/composer.json
new file mode 100644
index 0000000..62982a9
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/composer.json
@@ -0,0 +1,21 @@
+{
+ "name": "floriansemm/official-library-php-email-parser",
+ "type": "library",
+ "description": "Plancake Email Parser is a simple emailparser for php",
+ "keywords": ["email", "parser"],
+ "homepage": "http://www.plancake.com",
+ "version": "1.0.0",
+ "license": "GPLv3",
+ "authors": [
+ {
+ "name": "Daniele Occhipinti",
+ "email": "[email protected]"
+ }
+ ],
+ "require": {
+ "php": ">=5.3.0"
+ },
+ "autoload": {
+ "psr-0": { "PlancakeEmailParser": "." }
+ }
+}
diff --git a/floriansemm/official-library-php-email-parser/tests/emails/0.txt
b/floriansemm/official-library-php-email-parser/tests/emails/0.txt
new file mode 100644
index 0000000..1aa9eb8
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/tests/emails/0.txt
@@ -0,0 +1,68 @@
+Delivered-To: [email protected]
+Received: by 10.76.34.137 with SMTP id z9csp136640oai;
+ Tue, 28 Aug 2012 02:40:28 -0700 (PDT)
+Received: by 10.68.234.6 with SMTP id ua6mr41487056pbc.117.1346146817853;
+ Tue, 28 Aug 2012 02:40:17 -0700 (PDT)
+Return-Path: <[email protected]>
+Received: from xxxxx-asmtp001.mac.com (xxxxx-asmtp001.mac.com. [17.157.161.0])
+ by mx.google.com with ESMTP id
qs7si36267775pbc.282.2012.08.28.02.40.16;
+ Tue, 28 Aug 2012 02:40:17 -0700 (PDT)
+Received-SPF: pass (google.com: domain of [email protected] designates
17.157.161.0 as permitted sender) client-ip=17.157.161.0;
+Authentication-Results: mx.google.com; spf=pass (google.com: domain of
[email protected] designates 17.157.161.0 as permitted sender)
[email protected]
+MIME-version: 1.0
+Content-type: multipart/mixed; boundary="Boundary_(ID_HBjaZsKd/JYCOBj0NwKdIg)"
+Received: from pc-Pawel.local
+ (84-10-143-154.dynamic.chello.pl [84.10.143.154])
+ by xxxxx-asmtp001.mac.com
+ (Oracle Communications Messaging Server 7u4-23.01(7.0.4.23.0) 64bit (built Aug
+ 10 2011)) with ESMTPSA id <[email protected]> for
+ [email protected]; Tue, 28 Aug 2012 09:40:16 +0000 (GMT)
+X-Proofpoint-Virus-Version: vendor=fsecure
+ engine=2.50.10432:5.7.7855,1.0.428,0.0.0000
+ definitions=2012-08-28_02:2012-08-28,2012-08-27,1970-01-01 signatures=0
+X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0
+ ipscore=0 suspectscore=4 phishscore=0 bulkscore=0 adultscore=0 classifier=spam
+ adjust=0 reason=mlx scancount=1 engine=6.0.2-1203120001
+ definitions=main-1208280046
+Message-id: <[email protected]>
+Date: Tue, 28 Aug 2012 11:40:10 +0200
+From: Pawel <[email protected]>
+User-Agent: Postbox 3.0.5 (Macintosh/20120826)
+To: [email protected]
+Subject: =?UTF-8?B?emHFvMOzxYLEhyBnxJnFm2zEhSBqYcW6xYQgaSB6csOzYiBwcsOzYm4=?=
+ =?UTF-8?B?ZSB6YWRhbmllICUldG9k?=
+
+This is a multi-part message in MIME format.
+
+--Boundary_(ID_HBjaZsKd/JYCOBj0NwKdIg)
+Content-type: multipart/alternative;
+ boundary="Boundary_(ID_IwJgqMZPSLzwxvKroSd+xg)"
+
+
+--Boundary_(ID_IwJgqMZPSLzwxvKroSd+xg)
+Content-type: text/plain; CHARSET=US-ASCII; format=flowed
+Content-transfer-encoding: 7BIT
+
+This is a nonesense test-email to check Plancake Mail to Inbox feature.
+All Polish diacritics included ;-) tag also included for additional tests.
+It should look like in the picture attached.
+Best regards
+Pawel
+
+--Boundary_(ID_IwJgqMZPSLzwxvKroSd+xg)
+Content-type: text/html; CHARSET=US-ASCII
+Content-transfer-encoding: 7BIT
+
+<html><head>
+<meta http-equiv="content-type" content="text/html; charset=UTF-8"></head><body
+ style="font-family: tt; font-size: 10pt;" bgcolor="#FFFFFF"
+text="#000000">
+<div style="font-size: 10pt;font-family: tt;"><span style="font-family:
+monospace;">This is a nonesense test-email to check Plancake Mail to
+Inbox feature. All Polish diacritics included ;-) tag also included for
+additional tests.<br>It should look like in the picture attached.<br>Best
+ regards<br>Pawel<br></span></div>
+</body>
+</html>
+
+--Boundary_(ID_IwJgqMZPSLzwxvKroSd+xg)--
diff --git a/floriansemm/official-library-php-email-parser/tests/emails/1.txt
b/floriansemm/official-library-php-email-parser/tests/emails/1.txt
new file mode 100644
index 0000000..a08ab14
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/tests/emails/1.txt
@@ -0,0 +1,50 @@
+
+Delivered-To: [email protected]
+Received: by 10.114.17.33 with SMTP id l1csp3122ldd;
+ Tue, 18 Sep 2012 02:41:44 -0700 (PDT)
+Received: by 10.58.239.232 with SMTP id vv8mr9429162vec.37.1347961303872;
+ Tue, 18 Sep 2012 02:41:43 -0700 (PDT)
+Return-Path: <[email protected]>
+Received: from mail-vb0-f50.google.com (mail-vb0-f50.google.com
[209.85.212.50])
+ by mx.google.com with ESMTPS id l6si7688147vcq.72.2012.09.18.02.41.43
+ (version=TLSv1/SSLv3 cipher=OTHER);
+ Tue, 18 Sep 2012 02:41:43 -0700 (PDT)
+Received-SPF: neutral (google.com: 209.85.212.50 is neither permitted nor
denied by best guess record for domain of [email protected])
client-ip=209.85.212.50;
+Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.50
is neither permitted nor denied by best guess record for domain of
[email protected]) [email protected]
+Received: by mail-vb0-f50.google.com with SMTP id l22so8808870vbn.9
+ for <[email protected]>; Tue, 18 Sep 2012 02:41:43 -0700 (PDT)
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=google.com; s=20120113;
+ h=mime-version:x-originating-ip:from:date:message-id:subject:to
+ :content-type:x-gm-message-state;
+ bh=PspmOkExwaKjIUREisshzexR2oetA5uzuTOojKs40T0=;
+ b=c4Gqdb/v+bU+oDTpZhBBWcx+NMkKhesUWzEkXvJkMNePD7EEvc3/rMcrSoy4+I+8RR
+ gr3dfPEEdqZ769R3YFJ4xr3P5df1vxQhPfdanOpA7L2PwtRGBjXgLAZKENM9erZKmkdQ
+ q+uXwOYNLtNuF5kDKGX8TvC6AP2PUAlcKvIduGoJ30inP/noD0batOmI9BpDNT8NIFAK
+ ldnVuLB7Iy6aJK0REQQA5beFOm2xPvnqTVPYbD89xDjpjRIrCQ/hhM7pWmYPPHMoju7t
+ aeYSgvs5pv3Tfp0lMb5yBXIYp/WS6r80pElbjozctMs3TrEEKRbLdGKGc2t9Q9EIhRul
+ AfsQ==
+Received: by 10.52.36.34 with SMTP id n2mr4808159vdj.105.1347961302979; Tue,
+ 18 Sep 2012 02:41:42 -0700 (PDT)
+MIME-Version: 1.0
+Received: by 10.58.222.103 with HTTP; Tue, 18 Sep 2012 02:41:22 -0700 (PDT)
+X-Originating-IP: [109.158.215.220]
+From: "Dan @ Test.com" <[email protected]>
+Date: Tue, 18 Sep 2012 10:41:22 +0100
+Message-ID: <cacm7m_mmt14q-dqjeqqh8xv_jqsbrnga4owfxjkn0loe_bw...@mail.test.com>
+Subject: this is a test
+To: Daniele <[email protected]>
+Content-Type: multipart/alternative; boundary=20cf307f398ea295d904c9f6b2a6
+X-Gm-Message-State:
ALoCoQlh01kch4ywUSwY0xXJAZx7DW352l9t4+rs/FsY2P46f3kTi0FiEekDb37jju+fr0rhOr+3
+
+--20cf307f398ea295d904c9f6b2a6
+Content-Type: text/plain; charset=ISO-8859-1
+
+Hope it works!
+
+--20cf307f398ea295d904c9f6b2a6
+Content-Type: text/html; charset=ISO-8859-1
+
+Hope it works!<br><div title="signature"> </div>
+
+--20cf307f398ea295d904c9f6b2a6--
diff --git a/floriansemm/official-library-php-email-parser/tests/emails/2.txt
b/floriansemm/official-library-php-email-parser/tests/emails/2.txt
new file mode 100644
index 0000000..7e4cb16
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/tests/emails/2.txt
@@ -0,0 +1,52 @@
+
+Delivered-To: [email protected]
+Received: by 10.114.17.33 with SMTP id l1csp4056ldd;
+ Tue, 18 Sep 2012 03:26:33 -0700 (PDT)
+Received: by 10.221.1.137 with SMTP id nq9mr9146920vcb.16.1347963992703;
+ Tue, 18 Sep 2012 03:26:32 -0700 (PDT)
+Return-Path: <[email protected]>
+Received: from mail-vb0-f46.google.com (mail-vb0-f46.google.com
[209.85.212.46])
+ by mx.google.com with ESMTPS id nr9si7739478vcb.47.2012.09.18.03.26.31
+ (version=TLSv1/SSLv3 cipher=OTHER);
+ Tue, 18 Sep 2012 03:26:32 -0700 (PDT)
+Received-SPF: neutral (google.com: 209.85.212.46 is neither permitted nor
denied by best guess record for domain of [email protected])
client-ip=209.85.212.46;
+Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.46
is neither permitted nor denied by best guess record for domain of
[email protected]) [email protected]
+Received: by mail-vb0-f46.google.com with SMTP id ff1so4097773vbb.19
+ for <[email protected]>; Tue, 18 Sep 2012 03:26:31 -0700 (PDT)
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=google.com; s=20120113;
+ h=mime-version:x-originating-ip:from:date:message-id:subject:to
+ :content-type:x-gm-message-state;
+ bh=AkxZ77/pitG59A/NWKlbLstrhunK6KXfB2fNB4YSalk=;
+ b=bhfvZKO9bbkr4akjdJ5vaot480TiITsjBMdjtxCMAg4RPnoed6IsivejP9cJZcIIPq
+ N0O2CaPv1z9DyT4DXlPYJTAMUSvHg8KWZIUp7rfKZ0X7Y9OWWIHkIaApqfMpM61OF0qo
+ wbCG7boJ2fbtdDPZQ3z+LamDKAChU7ayuplQYN0vMqkpRlYw9YLnM6BOO4Yj66TZ8q6M
+ WAVdM1kFVP+r2QGd7ka3UWM55Ah9R9dg2SRmBN3W6EBV91IVWw4DQ9Ufucr65YnCU/GA
+ qe3AuaeHf0Th2CnMn/mlMbeEm+vG3WD+G3ZQ8+UpKkDFdN4GlrB3JnnDc6AV3o4weske
+ tYQA==
+Received: by 10.58.65.40 with SMTP id u8mr9411987ves.47.1347963991825; Tue, 18
+ Sep 2012 03:26:31 -0700 (PDT)
+MIME-Version: 1.0
+Received: by 10.58.222.103 with HTTP; Tue, 18 Sep 2012 03:26:11 -0700 (PDT)
+X-Originating-IP: [109.158.215.220]
+From: "Dan" <[email protected]>
+Date: Tue, 18 Sep 2012 11:26:11 +0100
+Message-ID: <CACm7M_MSh=skfbnw2t0s6d_rh1e3ntcauowd2jao55hwidx...@mail.test.com>
+Subject: =?ISO-2022-JP?B?GyRCJDMkbCRPJUYlOSVIJEckORsoQg==?=
+To: Daniele <[email protected]>
+Content-Type: multipart/alternative; boundary=047d7b6d8564e71cac04c9f75290
+X-Gm-Message-State:
ALoCoQlwrVoZ6rkTcekymixxwzWXjBHxmM0yFX4xQ/t74eEEfsoU2nSbGLhgaz8HYimU8WeCI7ll
+
+--047d7b6d8564e71cac04c9f75290
+Content-Type: text/plain; charset=ISO-2022-JP
+Content-Transfer-Encoding: 7bit
+
+$B$=$l$O:nIJ$r4|BT(B
+
+--047d7b6d8564e71cac04c9f75290
+Content-Type: text/html; charset=ISO-2022-JP
+Content-Transfer-Encoding: 7bit
+
+$B$=$l$O:nIJ$r4|BT(B<div title="signature"> </div>
+
+--047d7b6d8564e71cac04c9f75290--
diff --git
a/floriansemm/official-library-php-email-parser/tests/emails/from_ipad_with_attachment.txt
b/floriansemm/official-library-php-email-parser/tests/emails/from_ipad_with_attachment.txt
new file mode 100644
index 0000000..151fd18
--- /dev/null
+++
b/floriansemm/official-library-php-email-parser/tests/emails/from_ipad_with_attachment.txt
@@ -0,0 +1,116 @@
+Return-Path: <[email protected]>
+X-Original-To: [email protected]
+Delivered-To: [email protected]
+Received: from mail-wi0-f175.google.com (mail-wi0-f175.google.com
[209.85.212.175])
+ by server1.examplebox.com (Postfix) with ESMTP id 4D2F41BD0001
+ for <[email protected]>; Tue, 9 Oct 2012 18:23:24
+0100 (BST)
+Received: by mail-wi0-f175.google.com with SMTP id hq4so4164838wib.16
+ for <[email protected]>; Tue, 09 Oct 2012 10:23:24
-0700 (PDT)
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
+ d=google.com; s=20120113;
+ h=subject:from:content-type:message-id:date:to
+ :content-transfer-encoding:mime-version:x-mailer:x-gm-message-state;
+ bh=lZwtjDDR63eEQyHRrh6iaIeV+u3+bVKEbNh1HEr7PEk=;
+ b=lJvUiccuU7CBGYcweNmCtYtIbc4/Yv6bFCPJcuAGWl/E/0JyaW3ddtuonfDUJg4dgW
+ RPwZFbJIw+LSmJ2pvgwZLH3+EtTkxyu/I6eMD2kamY6h6OZX3PCAEtJOLDjnPSDTbPJX
+ 9MnAREflBgjzlV/qJIcJ4f1Jd4YQhrDHCfawEVpw1X8r8rbjiRwxkGMEttfju20zoFP1
+ T12+FYeNvYkEvVFmlN5I7Xfu5RFhjI5Bl1FpldBMipeouWZMsNLnI8R5GTkdfT2fW6uh
+ gVi1MY90uHlDQtJSvc4SuLYAJlTRtoYTeQRvHD/G4Z7cVU8OBFh9Tl/8xoA2OE9Pe2EC
+ m09Q==
+Received: by 10.180.87.34 with SMTP id u2mr6205630wiz.4.1349803404038;
+ Tue, 09 Oct 2012 10:23:24 -0700 (PDT)
+Received: from [192.168.1.102]
(host86-161-128-242.range86-161.btcentralplus.com. [86.161.128.242])
+ by mx.google.com with ESMTPS id b3sm25802929wie.0.2012.10.09.10.23.19
+ (version=TLSv1/SSLv3 cipher=OTHER);
+ Tue, 09 Oct 2012 10:23:21 -0700 (PDT)
+Subject: Voice Memo
+From: Dan Occhi <[email protected]>
+Content-Type: multipart/mixed;
boundary=Apple-Mail-08783E7E-BDCB-4708-8BF5-33F388A6F25E
+Message-Id: <[email protected]>
+Date: Tue, 9 Oct 2012 18:23:09 +0100
+To: "[email protected]"
<[email protected]>
+Content-Transfer-Encoding: 7bit
+Mime-Version: 1.0 (1.0)
+X-Mailer: iPad Mail (9B206)
+X-Gm-Message-State:
ALoCoQl85Cg6qs32nNDmF9Dfb9MxUWrp3B60UwPIgbbUOsz6lvJr89zMNMyii0pADDHwLLcHxU5t
+
+
+--Apple-Mail-08783E7E-BDCB-4708-8BF5-33F388A6F25E
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain;
+ charset=us-ascii
+
+
+
+
+--Apple-Mail-08783E7E-BDCB-4708-8BF5-33F388A6F25E
+Content-Disposition: attachment;
+ filename=example_vmr_09102012182307.3gp
+Content-Type: audio/caf;
+ name=example_vmr_09102012182307.3gp
+Content-Transfer-Encoding: base64
+
+Y2FmZgABAABkZXNjAAAAAAAAACBA5YiAAAAAAGltYTQAAAAAAAAARAAAAEAAAAACAAAAAGt1a2kA
+AAAAAAAAAGZyZWUAAAAAAAAPpAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
+AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA=
+
+--Apple-Mail-08783E7E-BDCB-4708-8BF5-33F388A6F25E
+Content-Transfer-Encoding: 7bit
+Content-Type: text/plain;
+ charset=us-ascii
+
+
+
+
+Sent from my iPad
+--Apple-Mail-08783E7E-BDCB-4708-8BF5-33F388A6F25E--
diff --git
a/floriansemm/official-library-php-email-parser/tests/emails/subject_on_multiple_lines.txt
b/floriansemm/official-library-php-email-parser/tests/emails/subject_on_multiple_lines.txt
new file mode 100644
index 0000000..06c7084
--- /dev/null
+++
b/floriansemm/official-library-php-email-parser/tests/emails/subject_on_multiple_lines.txt
@@ -0,0 +1,24 @@
+Return-Path: <[email protected]>
+Delivered-To: [email protected]
+Received: from h0.host.net (HELO queue) (123.123.33.50)
+ by h0.host.net with SMTP; 10 May 2012 16:41:46 +0200
+Received: from mx.aruba.it (321.321.157.29)
+ by mx.host.net with SMTP; 10 May 2012 16:41:44 +0200
+Received: (qmail 11142 invoked by uid 89); 10 May 2012 14:41:43 -0000
+Date: 10 May 2012 14:41:43 -0000
+Message-ID: <[email protected]>
+Delivered-To: Autoresponder
+To: [email protected]
+From: [email protected]
+Subject: Re: =?UTF-8?Q?Testo=20Del=20di=20Soggetto=20Che=20?=
+ =?UTF-8?Q?Va=20A=20Capo=20In=20UTF8=20?=
+X-Spam-Check: DONE|U 0.500569/N
+X-Spam-Check: OK
+
+
+
+Da: [email protected]
+Oggetto: Grazie!!!
+
+Nome Cognome
+
diff --git a/floriansemm/official-library-php-email-parser/tests/run_tests.php
b/floriansemm/official-library-php-email-parser/tests/run_tests.php
new file mode 100644
index 0000000..543312e
--- /dev/null
+++ b/floriansemm/official-library-php-email-parser/tests/run_tests.php
@@ -0,0 +1,18 @@
+<?php
+
+// run this as:
+// php run_tests.php
+
+require_once("../PlancakeEmailParser.php");
+
+$emails = glob('./emails/*');
+
+echo "\r\n\r\n\r\n";
+
+foreach($emails as $email) {
+ echo "Email $email \r\n";
+ $emailParser = new PlancakeEmailParser(file_get_contents($email));
+ echo "subject: " . $emailParser->getSubject() . "\r\n";
+ echo "body: " . $emailParser->getBody() . "\r\n";
+ echo "\r\n\r\n\r\n";
+}
--
To view, visit https://gerrit.wikimedia.org/r/170369
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5cc3d2eda7188628fd016950a16ffe63c2ae6f6f
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/vendor
Gerrit-Branch: master
Gerrit-Owner: 01tonythomas <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits