dolibarr/htdocs/webportal/controllers/document.controller.class.php

307 lines
9.0 KiB
PHP
Raw Normal View History

2023-09-12 15:12:30 +02:00
<?php
2023-09-12 15:26:12 +02:00
require_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
2023-09-12 15:12:30 +02:00
2024-01-24 11:09:30 +01:00
2023-09-12 16:05:24 +02:00
/**
* Class for DocumentController
*/
2023-09-12 15:12:30 +02:00
class DocumentController extends Controller
{
2023-09-12 15:26:12 +02:00
/**
* @var string Action
*/
public $action;
/**
2024-01-24 14:38:01 +01:00
* @var string Attachment
2023-09-12 15:26:12 +02:00
*/
public $attachment;
/**
* @var string Encoding
*/
public $encoding;
/**
* @var int Entity
*/
public $entity;
/**
* @var string File name
*/
public $filename;
/**
* @var string Full path of original file
*/
public $fullpath_original_file;
/**
* @var string Full path of original file with encoded for OS
*/
public $fullpath_original_file_osencoded;
/**
* @var string Module of document ('module', 'module_user_temp', 'module_user' or 'module_temp'). Example: 'medias', 'invoice', 'logs', 'tax-vat', ...
2023-09-12 15:26:12 +02:00
*/
public $modulepart;
/**
* @var string Relative path with filename, relative to modulepart.
*/
public $original_file;
/**
* @var string Mime type of file
*/
public $type;
/**
* Init
*
2023-09-12 17:08:19 +02:00
* @return void
2023-09-12 15:26:12 +02:00
*/
public function init()
{
global $conf, $hookmanager;
define('MAIN_SECURITY_FORCECSP', "default-src: 'none'");
if (!defined('NOTOKENRENEWAL')) {
define('NOTOKENRENEWAL', '1');
}
if (!defined('NOREQUIREMENU')) {
define('NOREQUIREMENU', '1');
}
if (!defined('NOREQUIREHTML')) {
define('NOREQUIREHTML', '1');
}
if (!defined('NOREQUIREAJAX')) {
define('NOREQUIREAJAX', '1');
}
$context = Context::getInstance();
$encoding = '';
$action = GETPOST('action', 'aZ09');
$original_file = GETPOST('file', 'alphanohtml'); // Do not use urldecode here ($_GET are already decoded by PHP).
$modulepart = GETPOST('modulepart', 'alpha');
Fix: GETPOST(...,'int') to GETPOSTINT(...) (#28448) * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: GETPOST(...,'int') to GETPOSTINT(...) # Fix: GETPOST(...,'int') to GETPOSTINT(...) Converted using Phan plugin * Fix: Update spelling exceptions * Qual: Ignore Phan Notice
2024-02-27 14:05:53 +01:00
$entity = GETPOSTINT('entity') ? GETPOSTINT('entity') : $conf->entity;
$socId = GETPOSTINT('soc_id');
2023-09-12 15:26:12 +02:00
// Security check
if (empty($modulepart)) {
httponly_accessforbidden('Bad link. Bad value for parameter modulepart', 400);
2024-02-26 15:02:39 +01:00
exit;
2023-09-12 15:26:12 +02:00
}
if (empty($original_file)) {
httponly_accessforbidden('Bad link. Missing identification to find file (original_file)', 400);
2024-02-26 15:02:39 +01:00
exit;
2023-09-12 15:26:12 +02:00
}
// get original file
$ecmfile = '';
// Define attachment (attachment=true to force choice popup 'open'/'save as')
$attachment = true;
if (preg_match('/\.(html|htm)$/i', $original_file)) {
$attachment = false;
}
if (isset($_GET["attachment"])) {
$attachment = GETPOST("attachment", 'alpha') ? true : false;
}
Fix #28071 - New branch to fix bad merge (#28083) * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Qual: Introduce getDataToShowPhoto to prepare generic code * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Fix missing trans * Fix langs * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Remove useless files in web templates * Clean code * Fix duplicate translation key * Fix duplicate translation key * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Fix duplicate key * Fix $object * Debug v19 * WIP SMSing * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * WIP EMAILINGS_SUPPORT_ALSO_SMS * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * WIP SMSing * Debug the "validate" feature * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Clean code * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Move rights->x->y into hasRight('x', 'y') * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Enhance rector to fix empty($user->rights->modulex->perm1) * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Fix template to use v19 dev rules * Fix use v19 dev rules * Fix phpunit * Debug v19 * Clean code * Use rector to convert user->rights into user->hasRight * Clean code * Use rector to convert user->rights into user->hasRight * Use rector to convert user->rights into user->hasRight * Clean code * Fix phpcs * add editorconfig for sql files (#27999) Co-authored-by: Laurent Destailleur <eldy@destailleur.fr> * add model_pdf field in llx_ticket-ticket.sql (#27996) * add model_pdf field in llx_ticket-ticket.sql * Update 19.0.0-20.0.0.sql * Update 19.0.0-20.0.0.sql * Improve wording in README (#27994) * fix phpstan (#27989) * fix phpstan * Update UserRightsToFunction.php --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr> * Qual: Fix spelling/working in datapolicy translations (#28006) # Qual: Fix spelling/wording in datapolicy translations Fixed some spelling and wording in datapolicy translations. * qual: phpstan for htdocs/ticket/class/ticketstats.class.php (#27986) htdocs/ticket/class/ticketstats.class.php 98 Parameter #1 $year (string) of method TicketStats::getNbByMonth() should be compatible with parameter $year (int) of method Stats::getNbByMonth() * Merge branch '19.0' of git@github.com:Dolibarr/dolibarr.git into develop * Fix user with readonly perm on email template must be able to read. * Fix doc * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Better message * Add missing fields in merge of thirdparty * Debug v19 selection of ticket printer per terminal * Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop * Use constant * NEW: Adding a recipient on emails sent, change status to sent partialy. * fix travis (#28052) * fix travis * Update partnership.class.php * fix php doc (#28047) * fix undefined array key (#28048) * Add region and departament for Cuba (#28046) * Update llx_10_c_regions.sql Add Cuba Regions (id_country=77) * Update llx_20_c_departements.sql Add Provinces Cuba (id country=77) * Find the typo (#28050) * Find the typo * clean code * add last_main_doc field to product (#28045) * add las_main_doc field to product * add field fetch * NEW Add Categorie filter for ActionComm (#28041) * New Add Categorie filter for ActionComm New Add Categorie filter for ActionComm * Fix space errors Fix space errors * Fix space errors 2 Fix space errors 2 * Update cunits.class.php (#28056) FIX: error SQL when creating a Cunit * Update codespell-lines-ignore.txt to avoid PR merge conflict --------- Co-authored-by: Laurent Destailleur <eldy@destailleur.fr> Co-authored-by: Frédéric FRANCE <frederic34@users.noreply.github.com> Co-authored-by: thibdrev <thibault.drevet@gmail.com> Co-authored-by: sonikf <93765174+sonikf@users.noreply.github.com> Co-authored-by: Ikarus <44511582+LeKarSol@users.noreply.github.com> Co-authored-by: Anthony Damhet <73399671+EchoLoGeek@users.noreply.github.com> Co-authored-by: Quentin-Seekness <72733832+Quentin-Seekness@users.noreply.github.com>
2024-02-09 15:58:49 +01:00
if (getDolGlobalString('MAIN_DISABLE_FORCE_SAVEAS')) {
2023-09-12 15:26:12 +02:00
$attachment = false;
}
// Define mime type
if (GETPOST('type', 'alpha')) {
$type = GETPOST('type', 'alpha');
} else {
$type = dol_mimetype($original_file);
}
// Security: Force to octet-stream if file is a dangerous file. For example when it is a .noexe file
// We do not force if file is a javascript to be able to get js from website module with <script src="
// Note: Force whatever is $modulepart seems ok.
if (!in_array($type, array('text/x-javascript')) && !dolIsAllowedForPreview($original_file)) {
$type = 'application/octet-stream';
}
// Security: Delete string ../ or ..\ into $original_file
$original_file = preg_replace('/\.\.+/', '..', $original_file); // Replace '... or more' with '..'
$original_file = str_replace('../', '/', $original_file);
$original_file = str_replace('..\\', '/', $original_file);
// Check security and set return info with full path of file
$accessallowed = 0; // not allowed by default
$moduleName = $modulepart;
$moduleNameEn = $moduleName;
if ($moduleName == 'commande') {
$moduleNameEn = 'order';
} elseif ($moduleName == 'facture') {
$moduleNameEn = 'invoice';
}
$moduleNameUpperEn = strtoupper($moduleNameEn);
// check config access
// and file mime type (only PDF)
// and check login access
if (getDolGlobalInt('WEBPORTAL_' . $moduleNameUpperEn . '_LIST_ACCESS')
&& in_array($type, array('application/pdf'))
&& ($context->logged_thirdparty && $context->logged_thirdparty->id > 0)
&& $context->logged_thirdparty->id == $socId
) {
if (isModEnabled($moduleName) && isset($conf->{$moduleName}->multidir_output[$entity])) {
$original_file = $conf->{$moduleName}->multidir_output[$entity] . '/' . $original_file;
$accessallowed = 1;
}
}
$fullpath_original_file = $original_file; // $fullpath_original_file is now a full path name
// Security:
// Limit access if permissions are wrong
if (!$accessallowed) {
accessforbidden();
}
// Security:
// We refuse directory transversal change and pipes in file names
if (preg_match('/\.\./', $fullpath_original_file) || preg_match('/[<>|]/', $fullpath_original_file)) {
dol_syslog("Refused to deliver file " . $fullpath_original_file);
print "ErrorFileNameInvalid: " . dol_escape_htmltag($original_file);
exit;
}
// Find the subdirectory name as the reference
$refname = basename(dirname($original_file) . "/");
$filename = basename($fullpath_original_file);
$filename = preg_replace('/\.noexe$/i', '', $filename);
// Output file on browser
dol_syslog("document controller download $fullpath_original_file filename=$filename content-type=$type");
$fullpath_original_file_osencoded = dol_osencode($fullpath_original_file); // New file name encoded in OS encoding charset
// This test if file exists should be useless. We keep it to find bug more easily
if (!file_exists($fullpath_original_file_osencoded)) {
dol_syslog("ErrorFileDoesNotExists: " . $fullpath_original_file);
print "ErrorFileDoesNotExists: " . $original_file;
exit;
}
$fileSize = dol_filesize($fullpath_original_file);
$fileSizeMaxDefault = 20 * 1024; // 20 Mo by default
$fileSizeMax = getDolGlobalInt('MAIN_SECURITY_MAXFILESIZE_DOWNLOADED', $fileSizeMaxDefault);
if ($fileSize > $fileSizeMax) {
dol_syslog('ErrorFileSizeTooLarge: ' . $fileSize);
print 'ErrorFileSizeTooLarge: ' . $fileSize . ' (max ' . $fileSizeMax . ')';
exit;
}
// Hooks
$hookmanager->initHooks(array('document'));
$parameters = array('ecmfile' => $ecmfile, 'modulepart' => $modulepart, 'original_file' => $original_file,
'entity' => $entity, 'refname' => $refname, 'fullpath_original_file' => $fullpath_original_file,
'filename' => $filename, 'fullpath_original_file_osencoded' => $fullpath_original_file_osencoded);
$object = new stdClass();
$reshook = $hookmanager->executeHooks('downloadDocument', $parameters, $object, $action); // Note that $action and $object may have been
if ($reshook < 0) {
Qual: Apply automatic phan fixes (deprecations, unneeded imports) (#28154) * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports). * Qual: Apply automatic phan fixes (deprecations, unneeded imports) # Qual: Apply automatic phan fixes (deprecations, unneeded imports) This applies automatic fixes by phan for deprecated functions, unneeded imports).
2024-02-13 21:46:12 +01:00
$errors = $hookmanager->error . (is_array($hookmanager->errors) ? (!empty($hookmanager->error) ? ', ' : '') . implode(', ', $hookmanager->errors) : '');
2023-09-12 15:26:12 +02:00
dol_syslog("document.php - Errors when executing the hook 'downloadDocument' : " . $errors);
print "ErrorDownloadDocumentHooks: " . $errors;
exit;
}
$this->action = $action;
$this->attachment = $attachment;
$this->encoding = $encoding;
$this->entity = $entity;
$this->filename = $filename;
$this->fullpath_original_file = $fullpath_original_file;
$this->fullpath_original_file_osencoded = $fullpath_original_file_osencoded;
$this->modulepart = $modulepart;
$this->original_file = $original_file;
$this->type = $type;
}
2023-09-12 15:12:30 +02:00
/**
* Check current access to controller
*
* @return bool
*/
2023-09-12 15:26:12 +02:00
public function checkAccess()
{
$this->accessRight = true;
2023-09-12 15:12:30 +02:00
2023-09-12 15:26:12 +02:00
return parent::checkAccess();
}
2023-09-12 15:12:30 +02:00
/**
* Action method is called before html output
* can be used to manage security and change context
*
2024-02-08 14:11:54 +01:00
* @return int Return integer < 0 on error, > 0 on success
2023-09-12 15:12:30 +02:00
*/
2023-09-12 15:26:12 +02:00
public function action()
{
$context = Context::getInstance();
if (!$context->controllerInstance->checkAccess()) {
2024-02-08 14:11:54 +01:00
return -1;
2023-09-12 15:26:12 +02:00
}
//$context = Context::getInstance();
//$context->title = $langs->trans('WebPortalDocumentTitle');
//$context->desc = $langs->trans('WebPortalDocumentDesc');
//$context->doNotDisplayHeaderBar=1;// hide default header
$this->init();
2024-02-08 14:11:54 +01:00
return 1;
2023-09-12 15:26:12 +02:00
}
/**
* Display
*
* @return void
*/
public function display()
{
$context = Context::getInstance();
if (!$context->controllerInstance->checkAccess()) {
$this->display404();
return;
}
// initialize
$attachment = $this->attachment;
$encoding = $this->encoding;
$filename = $this->filename;
$fullpath_original_file = $this->fullpath_original_file;
$fullpath_original_file_osencoded = $this->fullpath_original_file_osencoded;
$type = $this->type;
clearstatcache();
// Permissions are ok and file found, so we return it
top_httphead($type);
header('Content-Description: File Transfer');
if ($encoding) {
header('Content-Encoding: ' . $encoding);
}
// Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open)
if ($attachment) {
header('Content-Disposition: attachment; filename="' . $filename . '"');
} else {
header('Content-Disposition: inline; filename="' . $filename . '"');
}
header('Cache-Control: Public, must-revalidate');
header('Pragma: public');
// Send file now
header('Content-Length: ' . dol_filesize($fullpath_original_file));
readfileLowMemory($fullpath_original_file_osencoded);
}
2023-09-12 15:12:30 +02:00
}