diff --git a/main/document/showinframes.php b/main/document/showinframes.php index ec1ea3cfce..7387af9b0b 100755 --- a/main/document/showinframes.php +++ b/main/document/showinframes.php @@ -27,7 +27,7 @@ require_once __DIR__.'/../inc/global.inc.php'; api_protect_course_script(); $header_file = isset($_GET['file']) ? Security::remove_XSS($_GET['file']) : null; -$document_id = intval($_GET['id']); +$document_id = (int) $_GET['id']; $originIsLearnpath = isset($_GET['origin']) && $_GET['origin'] === 'learnpathitem'; $courseInfo = api_get_course_info(); $course_code = api_get_course_id(); diff --git a/main/inc/lib/api.lib.php b/main/inc/lib/api.lib.php index a4cffcde76..985dfbcab9 100644 --- a/main/inc/lib/api.lib.php +++ b/main/inc/lib/api.lib.php @@ -8833,13 +8833,10 @@ function api_create_protected_dir($name, $parentDirectory) } /** - * Sends an HTML email using the phpmailer class (and multipart/alternative to downgrade gracefully) + * Sends an email * Sender name and email can be specified, if not specified * name and email of the platform admin are used. * - * @author Bert Vanderkimpen ICT&O UGent - * @author Yannick Warnier - * * @param string name of recipient * @param string email of recipient * @param string email subject @@ -8851,9 +8848,8 @@ function api_create_protected_dir($name, $parentDirectory) * @param bool True for attaching a embedded file inside content html (optional) * @param array Additional parameters * - * @return int true if mail was sent + * @return bool true if mail was sent * - * @see class.phpmailer.php */ function api_mail_html( $recipientName, @@ -8864,9 +8860,13 @@ function api_mail_html( $senderEmail = '', $extra_headers = [], $data_file = [], - $embedded_image = false, + $embeddedImage = false, $additionalParameters = [] ) { + if (!api_valid_email($recipientEmail)) { + return false; + } + // Default values $notification = new Notification(); $defaultEmail = $notification->getDefaultPlatformSenderEmail(); @@ -8902,10 +8902,6 @@ function api_mail_html( );*/ - if (!api_valid_email($recipientEmail)) { - return 0; - } - /*if (is_array($extra_headers) && count($extra_headers) > 0) { foreach ($extra_headers as $key => $value) { switch (strtolower($key)) { @@ -8943,7 +8939,7 @@ function api_mail_html( } } - // Attachment ... + // Attachment if (!empty($data_file)) { foreach ($data_file as $file_attach) { if (!empty($file_attach['path']) && !empty($file_attach['filename'])) { @@ -9006,8 +9002,6 @@ function api_mail_html( $type = $message->getHeaders()->get('Content-Type'); $type->setCharset('utf-8'); - //$type->setValue('text/html'); - Container::getMailer()->send($message); return true; diff --git a/src/CoreBundle/Controller/ResourceController.php b/src/CoreBundle/Controller/ResourceController.php index d4284bbe91..6ee785dcaf 100644 --- a/src/CoreBundle/Controller/ResourceController.php +++ b/src/CoreBundle/Controller/ResourceController.php @@ -280,10 +280,8 @@ class ResourceController extends BaseResourceController implements CourseControl case 'user': // Only for me if (isset($share['only_me'])) { - error_log('only_me'); $repository->addResourceOnlyToMe($resourceNode); } else { - error_log('others'); // To other users $repository->addResourceToUserList($resourceNode, $idList); }