Merge pull request #7 from tuscanicz/develop
Recognizing mime boundary according to RFC
This commit is contained in:
commit
7ab8771989
|
@ -27,7 +27,7 @@ class MimeBoundaryAnalyser
|
||||||
*/
|
*/
|
||||||
public static function isMessageLineBoundary($mimeMessageLine)
|
public static function isMessageLineBoundary($mimeMessageLine)
|
||||||
{
|
{
|
||||||
return strlen($mimeMessageLine) > 0 && $mimeMessageLine[0] === "-";
|
return preg_match('/^--[0-9A-Za-z\s\'\/\+\_\,\-\.\:\=\?]+/', $mimeMessageLine) === 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -67,6 +67,8 @@ class MimeBoundaryAnalyserTest extends PHPUnit_Framework_TestCase
|
||||||
{
|
{
|
||||||
return [
|
return [
|
||||||
['-- this line is boundary', self::EXPECTED_IS_BOUNDARY],
|
['-- this line is boundary', self::EXPECTED_IS_BOUNDARY],
|
||||||
|
['--this line is boundary', self::EXPECTED_IS_BOUNDARY],
|
||||||
|
['--@ this line is not boundary', self::EXPECTED_IS_NOT_BOUNDARY],
|
||||||
['-- this line is also a boundary --', self::EXPECTED_IS_BOUNDARY],
|
['-- this line is also a boundary --', self::EXPECTED_IS_BOUNDARY],
|
||||||
['mesage line -- is not boundary', self::EXPECTED_IS_NOT_BOUNDARY],
|
['mesage line -- is not boundary', self::EXPECTED_IS_NOT_BOUNDARY],
|
||||||
[' -- mesage line -- is not boundary', self::EXPECTED_IS_NOT_BOUNDARY],
|
[' -- mesage line -- is not boundary', self::EXPECTED_IS_NOT_BOUNDARY],
|
||||||
|
|
Loading…
Reference in New Issue