Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New updating for preview php content #30155

Closed
wants to merge 15 commits into from

Conversation

lamrani002
Copy link
Contributor

@lamrani002 lamrani002 commented Jun 25, 2024

NEW|New updating for preview php content on Ckeditor

for exemple preview news :
gogog

@lamrani002 lamrani002 changed the title Add subject mail New updating for preview php content Jun 25, 2024
@@ -0,0 +1,58 @@
<?php
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the ajax service i think ?
If i am right, move the file into directory htdocs/core/ajax/emailingemplates.php.

top_httphead();

if ($_SERVER['REQUEST_METHOD'] == 'POST' && GETPOSTISSET('content')) {
$content = $_POST['content'];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$_POST use is forbidden.
You must use GETPOST()


$i = 0;
do {
$filePath = $directory . '/template_' . $i++ . '.php';
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The $directory = DOL_DATA_ROOT . '/mailing/email_template';
is inside the root where binary files are stored. It means the directory should be in readonly mode and is not writable by the web server on a secured installation.
Any temporaty files must be stored into a temp directory.
For example, you can use $conf->admin->dir_temp

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok it s solved

@eldy eldy added the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Jun 30, 2024
@lamrani002 lamrani002 removed the PR to fix or conflict to solve PR needs to be fixed to be integrated (except for conflicts, a comment describes the fix to do) label Aug 5, 2024
@eldy eldy closed this Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants