Fix Plaintext class
parent
2ff280d34c
commit
c311a65073
|
@ -244,13 +244,12 @@ class Plaintext
|
||||||
$part = '';
|
$part = '';
|
||||||
$break_pos = 0;
|
$break_pos = 0;
|
||||||
$comma_pos = 0;
|
$comma_pos = 0;
|
||||||
|
$pos = 0;
|
||||||
|
$word = '';
|
||||||
|
|
||||||
$limit = $baselimit;
|
$limit = $baselimit;
|
||||||
|
|
||||||
while ($message) {
|
while ($message) {
|
||||||
$word = $message;
|
|
||||||
$message = '';
|
|
||||||
$pos = 0;
|
|
||||||
$pos_word = mb_strpos($message, ' ');
|
$pos_word = mb_strpos($message, ' ');
|
||||||
$pos_paragraph = mb_strpos($message, "\n");
|
$pos_paragraph = mb_strpos($message, "\n");
|
||||||
|
|
||||||
|
@ -260,6 +259,9 @@ class Plaintext
|
||||||
$pos = $pos_word + 1;
|
$pos = $pos_word + 1;
|
||||||
} elseif ($pos_paragraph !== false) {
|
} elseif ($pos_paragraph !== false) {
|
||||||
$pos = $pos_paragraph + 1;
|
$pos = $pos_paragraph + 1;
|
||||||
|
} else {
|
||||||
|
$word = $message;
|
||||||
|
$message = '';
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim($message)) {
|
if (trim($message)) {
|
||||||
|
|
|
@ -32,6 +32,7 @@ class PlaintextTest extends FixtureTest
|
||||||
'Ich ignoriere auch Anfragen, wenn sie von Accounts kommen, die ggf. tausenden von anderen Accounts folgen, da ich davon ausgehe, (5/6)',
|
'Ich ignoriere auch Anfragen, wenn sie von Accounts kommen, die ggf. tausenden von anderen Accounts folgen, da ich davon ausgehe, (5/6)',
|
||||||
'dass da niemand ernsthaft so vielen Accounts folgen kann. (6/6)'
|
'dass da niemand ernsthaft so vielen Accounts folgen kann. (6/6)'
|
||||||
],
|
],
|
||||||
|
],
|
||||||
'test-2' => [
|
'test-2' => [
|
||||||
'data' => 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
|
'data' => 'Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet.',
|
||||||
'expected' => [
|
'expected' => [
|
||||||
|
@ -42,7 +43,6 @@ class PlaintextTest extends FixtureTest
|
||||||
'sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. (5/6)',
|
'sed diam voluptua. At vero eos et accusam et justo duo dolores et ea rebum. (5/6)',
|
||||||
'Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. (6/6)'
|
'Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor sit amet. (6/6)'
|
||||||
],
|
],
|
||||||
]
|
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue