kopia lustrzana https://github.com/newroco/mail2deck
update function to add inline attachment
rodzic
9e859850df
commit
7fa7a7f07e
|
@ -42,7 +42,7 @@ class CreateCardClass{
|
||||||
$hasCid = preg_match('/!\[.*?\]\(cid:[^)]+\)/', $description);
|
$hasCid = preg_match('/!\[.*?\]\(cid:[^)]+\)/', $description);
|
||||||
if (!empty($attachments)) {
|
if (!empty($attachments)) {
|
||||||
foreach ($attachments as $attachment) {
|
foreach ($attachments as $attachment) {
|
||||||
$filePath = NC_SERVER .'/remote.php/dav/files/'.NC_USER.'/Deck/'.$attachment;
|
$filePath = NC_SERVER .'/remote.php/dav/files/'.NC_ADMIN_USER.'/Deck/'.$attachment;
|
||||||
if ($hasCid) {
|
if ($hasCid) {
|
||||||
$description = preg_replace('/!\[' . preg_quote($attachment, '/') . '\]\(cid:[^)]+\)/',"[$attachment]($filePath)", $description);
|
$description = preg_replace('/!\[' . preg_quote($attachment, '/') . '\]\(cid:[^)]+\)/',"[$attachment]($filePath)", $description);
|
||||||
}else{
|
}else{
|
||||||
|
|
Ładowanie…
Reference in New Issue