@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | 8 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 9 | 9 | header('Content-type: application/javascript'); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | 8 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 9 | 9 | header('Content-type: application/manifest+json'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
| 4 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
| 5 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 4 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
| 5 | + if (!defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 6 | 6 | require_once '/home/ldestailleur/git/dolibarr_dev/htdocs/master.inc.php'; |
| 7 | 7 | } |
@@ -2,6 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
| 4 | 4 | if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
| 5 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 5 | + if (! defined('USEEXTERNALSERVER')) { |
|
| 6 | + define('USEEXTERNALSERVER', 1); |
|
| 7 | + } |
|
| 6 | 8 | require_once '/home/ldestailleur/git/dolibarr_dev/htdocs/master.inc.php'; |
| 7 | 9 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
| 9 | 9 | require_once './master.inc.php'; |
| 10 | 10 | } // Load master if not already loaded |
| 11 | -include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
|
| 11 | +include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
|
| 12 | 12 | |
| 13 | 13 | $encoding = ''; |
| 14 | 14 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // If we have a hash public (hashp), we guess the original_file. |
| 30 | 30 | if (!empty($hashp)) { |
| 31 | - include_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
| 31 | + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
| 32 | 32 | $ecmfile = new EcmFiles($db); |
| 33 | 33 | $result = $ecmfile->fetch(0, '', '', '', $hashp); |
| 34 | 34 | if ($result > 0) { |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | if ($modulepart) { // Not required, so often not defined, for link using public hashp parameter. |
| 43 | 43 | if ($moduleparttocheck == $modulepart) { |
| 44 | 44 | // We remove first level of directory |
| 45 | - $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir |
|
| 45 | + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir |
|
| 46 | 46 | //var_dump($original_file); exit; |
| 47 | 47 | } else { |
| 48 | 48 | print 'Bad link. File is from another module part.'; |
| 49 | 49 | } |
| 50 | 50 | } else { |
| 51 | 51 | $modulepart = $moduleparttocheck; |
| 52 | - $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir |
|
| 52 | + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | print "ErrorFileNotFoundWithSharedLink"; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | header('Pragma: cache'); // This is to avoid having Pragma: no-cache |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | -$refname = basename(dirname($original_file) . "/"); |
|
| 91 | +$refname = basename(dirname($original_file)."/"); |
|
| 92 | 92 | |
| 93 | 93 | // Get RSS news |
| 94 | 94 | if ($rss) { |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | $filename = $original_file; |
| 99 | 99 | $dir_temp = $conf->website->dir_temp; |
| 100 | 100 | |
| 101 | - include_once DOL_DOCUMENT_ROOT . '/website/class/website.class.php'; |
|
| 102 | - include_once DOL_DOCUMENT_ROOT . '/website/class/websitepage.class.php'; |
|
| 101 | + include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; |
|
| 102 | + include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; |
|
| 103 | 103 | $website = new Website($db); |
| 104 | 104 | $websitepage = new WebsitePage($db); |
| 105 | 105 | |
@@ -115,26 +115,26 @@ discard block |
||
| 115 | 115 | $eventarray = array(); |
| 116 | 116 | if (is_array($arrayofblogs)) { |
| 117 | 117 | foreach ($arrayofblogs as $blog) { |
| 118 | - $blog->fullpageurl = $website->virtualhost . '/' . $blog->pageurl . '.php'; |
|
| 118 | + $blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php'; |
|
| 119 | 119 | $eventarray[] = $blog; |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/xcal.lib.php"; |
|
| 124 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php"; |
|
| 125 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php"; |
|
| 123 | + require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php"; |
|
| 124 | + require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; |
|
| 125 | + require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; |
|
| 126 | 126 | |
| 127 | - dol_syslog("build_exportfile Build export file format=" . $format . ", type=" . $type . ", cachedelay=" . $cachedelay . ", filename=" . $filename . ", filters size=" . count($filters), LOG_DEBUG); |
|
| 127 | + dol_syslog("build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG); |
|
| 128 | 128 | |
| 129 | 129 | // Clean parameters |
| 130 | 130 | if (!$filename) { |
| 131 | 131 | $extension = 'rss'; |
| 132 | - $filename = $format . '.' . $extension; |
|
| 132 | + $filename = $format.'.'.$extension; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // Create dir and define output file (definitive and temporary) |
| 136 | 136 | $result = dol_mkdir($dir_temp); |
| 137 | - $outputfile = $dir_temp . '/' . $filename; |
|
| 137 | + $outputfile = $dir_temp.'/'.$filename; |
|
| 138 | 138 | |
| 139 | 139 | $result = 0; |
| 140 | 140 | |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if ($cachedelay) { |
| 144 | 144 | $nowgmt = dol_now(); |
| 145 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 145 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 146 | 146 | if (dol_filemtime($outputfile) > ($nowgmt - $cachedelay)) { |
| 147 | - dol_syslog("build_exportfile file " . $outputfile . " is not older than now - cachedelay (" . $nowgmt . " - " . $cachedelay . "). Build is canceled"); |
|
| 147 | + dol_syslog("build_exportfile file ".$outputfile." is not older than now - cachedelay (".$nowgmt." - ".$cachedelay."). Build is canceled"); |
|
| 148 | 148 | $buildfile = false; |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -160,20 +160,20 @@ discard block |
||
| 160 | 160 | dolChmod($outputfiletmp); |
| 161 | 161 | |
| 162 | 162 | // Write file |
| 163 | - $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost . '/wrapper.php?rss=1' . ($l ? '&l=' . $l : ''), $l); |
|
| 163 | + $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l); |
|
| 164 | 164 | |
| 165 | 165 | if ($result >= 0) { |
| 166 | 166 | if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) { |
| 167 | 167 | $result = 1; |
| 168 | 168 | } else { |
| 169 | - $error = 'Failed to rename ' . $outputfiletmp . ' into ' . $outputfile; |
|
| 170 | - dol_syslog("build_exportfile " . $error, LOG_ERR); |
|
| 169 | + $error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile; |
|
| 170 | + dol_syslog("build_exportfile ".$error, LOG_ERR); |
|
| 171 | 171 | dol_delete_file($outputfiletmp, 0, 1); |
| 172 | 172 | print $error; |
| 173 | 173 | exit(-1); |
| 174 | 174 | } |
| 175 | 175 | } else { |
| 176 | - dol_syslog("build_exportfile build_xxxfile function fails to for format=" . $format . " outputfiletmp=" . $outputfile, LOG_ERR); |
|
| 176 | + dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR); |
|
| 177 | 177 | dol_delete_file($outputfiletmp, 0, 1); |
| 178 | 178 | $langs->load("errors"); |
| 179 | 179 | print $langs->trans("ErrorFailToCreateFile", $outputfile); |
@@ -195,26 +195,26 @@ discard block |
||
| 195 | 195 | $outputencoding = 'UTF-8'; |
| 196 | 196 | |
| 197 | 197 | if ($contenttype) { |
| 198 | - header('Content-Type: ' . $contenttype . ($outputencoding ? '; charset=' . $outputencoding : '')); |
|
| 198 | + header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : '')); |
|
| 199 | 199 | } |
| 200 | 200 | if ($attachment) { |
| 201 | - header('Content-Disposition: attachment; filename="' . $filename . '"'); |
|
| 201 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | // Ajout directives pour resoudre bug IE |
| 205 | 205 | //header('Cache-Control: Public, must-revalidate'); |
| 206 | 206 | //header('Pragma: public'); |
| 207 | 207 | if ($cachedelay) { |
| 208 | - header('Cache-Control: max-age=' . $cachedelay . ', private, must-revalidate'); |
|
| 208 | + header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate'); |
|
| 209 | 209 | } else { |
| 210 | 210 | header('Cache-Control: private, must-revalidate'); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | // Clean parameters |
| 214 | - $outputfile = $dir_temp . '/' . $filename; |
|
| 214 | + $outputfile = $dir_temp.'/'.$filename; |
|
| 215 | 215 | $result = readfile($outputfile); |
| 216 | 216 | if (!$result) { |
| 217 | - print 'File ' . $outputfile . ' was empty.'; |
|
| 217 | + print 'File '.$outputfile.' was empty.'; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); |
@@ -222,10 +222,10 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | } elseif ($modulepart == "mycompany" && preg_match('/^\/?logos\//', $original_file)) { |
| 224 | 224 | // Get logos |
| 225 | - readfile(dol_osencode($conf->mycompany->dir_output . "/" . $original_file)); |
|
| 225 | + readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file)); |
|
| 226 | 226 | } else { |
| 227 | 227 | // Find the subdirectory name as the reference |
| 228 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 228 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 229 | 229 | $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, null, $refname); |
| 230 | 230 | $accessallowed = empty($check_access['accessallowed']) ? '' : $check_access['accessallowed']; |
| 231 | 231 | $sqlprotectagainstexternals = empty($check_access['sqlprotectagainstexternals']) ? '' : $check_access['sqlprotectagainstexternals']; |
@@ -252,24 +252,24 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | // This test if file exists should be useless. We keep it to find bug more easily |
| 254 | 254 | if (!file_exists($fullpath_original_file_osencoded)) { |
| 255 | - print "ErrorFileDoesNotExists: " . dol_escape_htmltag($original_file); |
|
| 255 | + print "ErrorFileDoesNotExists: ".dol_escape_htmltag($original_file); |
|
| 256 | 256 | exit; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | // Permissions are ok and file found, so we return it |
| 260 | 260 | //top_httphead($type); |
| 261 | - header('Content-Type: ' . $type); |
|
| 261 | + header('Content-Type: '.$type); |
|
| 262 | 262 | header('Content-Description: File Transfer'); |
| 263 | 263 | if ($encoding) { |
| 264 | - header('Content-Encoding: ' . $encoding); |
|
| 264 | + header('Content-Encoding: '.$encoding); |
|
| 265 | 265 | } |
| 266 | 266 | // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open) |
| 267 | 267 | if ($attachment) { |
| 268 | - header('Content-Disposition: attachment; filename="' . $filename . '"'); |
|
| 268 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
| 269 | 269 | } else { |
| 270 | - header('Content-Disposition: inline; filename="' . $filename . '"'); |
|
| 270 | + header('Content-Disposition: inline; filename="'.$filename.'"'); |
|
| 271 | 271 | } |
| 272 | - header('Content-Length: ' . dol_filesize($fullpath_original_file)); |
|
| 272 | + header('Content-Length: '.dol_filesize($fullpath_original_file)); |
|
| 273 | 273 | |
| 274 | 274 | readfile($fullpath_original_file_osencoded); |
| 275 | 275 | } |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | 8 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 9 | 9 | header('Content-type: application/javascript'); |
@@ -1,9 +1,9 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | 8 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 9 | 9 | header('Content-type: application/manifest+json'); |
@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
| 4 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
|
| 5 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 4 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
|
| 5 | + if (!defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 6 | 6 | require_once '/home/ldestailleur/git/dolibarr_dev/htdocs/master.inc.php'; |
| 7 | 7 | } |
@@ -2,6 +2,8 @@ |
||
| 2 | 2 | |
| 3 | 3 | // File generated to link to the master file - DO NOT MODIFY - It is just an include |
| 4 | 4 | if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { |
| 5 | - if (! defined('USEEXTERNALSERVER')) define('USEEXTERNALSERVER', 1); |
|
| 5 | + if (! defined('USEEXTERNALSERVER')) { |
|
| 6 | + define('USEEXTERNALSERVER', 1); |
|
| 7 | + } |
|
| 6 | 8 | require_once '/home/ldestailleur/git/dolibarr_dev/htdocs/master.inc.php'; |
| 7 | 9 | } |
@@ -8,7 +8,7 @@ discard block |
||
| 8 | 8 | if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { |
| 9 | 9 | require_once './master.inc.php'; |
| 10 | 10 | } // Load master if not already loaded |
| 11 | -include_once DOL_DOCUMENT_ROOT . '/core/lib/images.lib.php'; |
|
| 11 | +include_once DOL_DOCUMENT_ROOT.'/core/lib/images.lib.php'; |
|
| 12 | 12 | |
| 13 | 13 | $encoding = ''; |
| 14 | 14 | |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | |
| 29 | 29 | // If we have a hash public (hashp), we guess the original_file. |
| 30 | 30 | if (!empty($hashp)) { |
| 31 | - include_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php'; |
|
| 31 | + include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php'; |
|
| 32 | 32 | $ecmfile = new EcmFiles($db); |
| 33 | 33 | $result = $ecmfile->fetch(0, '', '', '', $hashp); |
| 34 | 34 | if ($result > 0) { |
@@ -42,14 +42,14 @@ discard block |
||
| 42 | 42 | if ($modulepart) { // Not required, so often not defined, for link using public hashp parameter. |
| 43 | 43 | if ($moduleparttocheck == $modulepart) { |
| 44 | 44 | // We remove first level of directory |
| 45 | - $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir |
|
| 45 | + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir |
|
| 46 | 46 | //var_dump($original_file); exit; |
| 47 | 47 | } else { |
| 48 | 48 | print 'Bad link. File is from another module part.'; |
| 49 | 49 | } |
| 50 | 50 | } else { |
| 51 | 51 | $modulepart = $moduleparttocheck; |
| 52 | - $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir |
|
| 52 | + $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir |
|
| 53 | 53 | } |
| 54 | 54 | } else { |
| 55 | 55 | print "ErrorFileNotFoundWithSharedLink"; |
@@ -88,7 +88,7 @@ discard block |
||
| 88 | 88 | header('Pragma: cache'); // This is to avoid having Pragma: no-cache |
| 89 | 89 | } |
| 90 | 90 | |
| 91 | -$refname = basename(dirname($original_file) . "/"); |
|
| 91 | +$refname = basename(dirname($original_file)."/"); |
|
| 92 | 92 | |
| 93 | 93 | // Get RSS news |
| 94 | 94 | if ($rss) { |
@@ -98,8 +98,8 @@ discard block |
||
| 98 | 98 | $filename = $original_file; |
| 99 | 99 | $dir_temp = $conf->website->dir_temp; |
| 100 | 100 | |
| 101 | - include_once DOL_DOCUMENT_ROOT . '/website/class/website.class.php'; |
|
| 102 | - include_once DOL_DOCUMENT_ROOT . '/website/class/websitepage.class.php'; |
|
| 101 | + include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php'; |
|
| 102 | + include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php'; |
|
| 103 | 103 | $website = new Website($db); |
| 104 | 104 | $websitepage = new WebsitePage($db); |
| 105 | 105 | |
@@ -115,26 +115,26 @@ discard block |
||
| 115 | 115 | $eventarray = array(); |
| 116 | 116 | if (is_array($arrayofblogs)) { |
| 117 | 117 | foreach ($arrayofblogs as $blog) { |
| 118 | - $blog->fullpageurl = $website->virtualhost . '/' . $blog->pageurl . '.php'; |
|
| 118 | + $blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php'; |
|
| 119 | 119 | $eventarray[] = $blog; |
| 120 | 120 | } |
| 121 | 121 | } |
| 122 | 122 | |
| 123 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/xcal.lib.php"; |
|
| 124 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php"; |
|
| 125 | - require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php"; |
|
| 123 | + require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php"; |
|
| 124 | + require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php"; |
|
| 125 | + require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php"; |
|
| 126 | 126 | |
| 127 | - dol_syslog("build_exportfile Build export file format=" . $format . ", type=" . $type . ", cachedelay=" . $cachedelay . ", filename=" . $filename . ", filters size=" . count($filters), LOG_DEBUG); |
|
| 127 | + dol_syslog("build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG); |
|
| 128 | 128 | |
| 129 | 129 | // Clean parameters |
| 130 | 130 | if (!$filename) { |
| 131 | 131 | $extension = 'rss'; |
| 132 | - $filename = $format . '.' . $extension; |
|
| 132 | + $filename = $format.'.'.$extension; |
|
| 133 | 133 | } |
| 134 | 134 | |
| 135 | 135 | // Create dir and define output file (definitive and temporary) |
| 136 | 136 | $result = dol_mkdir($dir_temp); |
| 137 | - $outputfile = $dir_temp . '/' . $filename; |
|
| 137 | + $outputfile = $dir_temp.'/'.$filename; |
|
| 138 | 138 | |
| 139 | 139 | $result = 0; |
| 140 | 140 | |
@@ -142,9 +142,9 @@ discard block |
||
| 142 | 142 | |
| 143 | 143 | if ($cachedelay) { |
| 144 | 144 | $nowgmt = dol_now(); |
| 145 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 145 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 146 | 146 | if (dol_filemtime($outputfile) > ($nowgmt - $cachedelay)) { |
| 147 | - dol_syslog("build_exportfile file " . $outputfile . " is not older than now - cachedelay (" . $nowgmt . " - " . $cachedelay . "). Build is canceled"); |
|
| 147 | + dol_syslog("build_exportfile file ".$outputfile." is not older than now - cachedelay (".$nowgmt." - ".$cachedelay."). Build is canceled"); |
|
| 148 | 148 | $buildfile = false; |
| 149 | 149 | } |
| 150 | 150 | } |
@@ -160,20 +160,20 @@ discard block |
||
| 160 | 160 | dolChmod($outputfiletmp); |
| 161 | 161 | |
| 162 | 162 | // Write file |
| 163 | - $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost . '/wrapper.php?rss=1' . ($l ? '&l=' . $l : ''), $l); |
|
| 163 | + $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l); |
|
| 164 | 164 | |
| 165 | 165 | if ($result >= 0) { |
| 166 | 166 | if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) { |
| 167 | 167 | $result = 1; |
| 168 | 168 | } else { |
| 169 | - $error = 'Failed to rename ' . $outputfiletmp . ' into ' . $outputfile; |
|
| 170 | - dol_syslog("build_exportfile " . $error, LOG_ERR); |
|
| 169 | + $error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile; |
|
| 170 | + dol_syslog("build_exportfile ".$error, LOG_ERR); |
|
| 171 | 171 | dol_delete_file($outputfiletmp, 0, 1); |
| 172 | 172 | print $error; |
| 173 | 173 | exit(-1); |
| 174 | 174 | } |
| 175 | 175 | } else { |
| 176 | - dol_syslog("build_exportfile build_xxxfile function fails to for format=" . $format . " outputfiletmp=" . $outputfile, LOG_ERR); |
|
| 176 | + dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR); |
|
| 177 | 177 | dol_delete_file($outputfiletmp, 0, 1); |
| 178 | 178 | $langs->load("errors"); |
| 179 | 179 | print $langs->trans("ErrorFailToCreateFile", $outputfile); |
@@ -195,26 +195,26 @@ discard block |
||
| 195 | 195 | $outputencoding = 'UTF-8'; |
| 196 | 196 | |
| 197 | 197 | if ($contenttype) { |
| 198 | - header('Content-Type: ' . $contenttype . ($outputencoding ? '; charset=' . $outputencoding : '')); |
|
| 198 | + header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : '')); |
|
| 199 | 199 | } |
| 200 | 200 | if ($attachment) { |
| 201 | - header('Content-Disposition: attachment; filename="' . $filename . '"'); |
|
| 201 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
| 202 | 202 | } |
| 203 | 203 | |
| 204 | 204 | // Ajout directives pour resoudre bug IE |
| 205 | 205 | //header('Cache-Control: Public, must-revalidate'); |
| 206 | 206 | //header('Pragma: public'); |
| 207 | 207 | if ($cachedelay) { |
| 208 | - header('Cache-Control: max-age=' . $cachedelay . ', private, must-revalidate'); |
|
| 208 | + header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate'); |
|
| 209 | 209 | } else { |
| 210 | 210 | header('Cache-Control: private, must-revalidate'); |
| 211 | 211 | } |
| 212 | 212 | |
| 213 | 213 | // Clean parameters |
| 214 | - $outputfile = $dir_temp . '/' . $filename; |
|
| 214 | + $outputfile = $dir_temp.'/'.$filename; |
|
| 215 | 215 | $result = readfile($outputfile); |
| 216 | 216 | if (!$result) { |
| 217 | - print 'File ' . $outputfile . ' was empty.'; |
|
| 217 | + print 'File '.$outputfile.' was empty.'; |
|
| 218 | 218 | } |
| 219 | 219 | |
| 220 | 220 | // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename)); |
@@ -222,10 +222,10 @@ discard block |
||
| 222 | 222 | } |
| 223 | 223 | } elseif ($modulepart == "mycompany" && preg_match('/^\/?logos\//', $original_file)) { |
| 224 | 224 | // Get logos |
| 225 | - readfile(dol_osencode($conf->mycompany->dir_output . "/" . $original_file)); |
|
| 225 | + readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file)); |
|
| 226 | 226 | } else { |
| 227 | 227 | // Find the subdirectory name as the reference |
| 228 | - include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php'; |
|
| 228 | + include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php'; |
|
| 229 | 229 | $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, null, $refname); |
| 230 | 230 | $accessallowed = empty($check_access['accessallowed']) ? '' : $check_access['accessallowed']; |
| 231 | 231 | $sqlprotectagainstexternals = empty($check_access['sqlprotectagainstexternals']) ? '' : $check_access['sqlprotectagainstexternals']; |
@@ -252,24 +252,24 @@ discard block |
||
| 252 | 252 | |
| 253 | 253 | // This test if file exists should be useless. We keep it to find bug more easily |
| 254 | 254 | if (!file_exists($fullpath_original_file_osencoded)) { |
| 255 | - print "ErrorFileDoesNotExists: " . dol_escape_htmltag($original_file); |
|
| 255 | + print "ErrorFileDoesNotExists: ".dol_escape_htmltag($original_file); |
|
| 256 | 256 | exit; |
| 257 | 257 | } |
| 258 | 258 | |
| 259 | 259 | // Permissions are ok and file found, so we return it |
| 260 | 260 | //top_httphead($type); |
| 261 | - header('Content-Type: ' . $type); |
|
| 261 | + header('Content-Type: '.$type); |
|
| 262 | 262 | header('Content-Description: File Transfer'); |
| 263 | 263 | if ($encoding) { |
| 264 | - header('Content-Encoding: ' . $encoding); |
|
| 264 | + header('Content-Encoding: '.$encoding); |
|
| 265 | 265 | } |
| 266 | 266 | // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open) |
| 267 | 267 | if ($attachment) { |
| 268 | - header('Content-Disposition: attachment; filename="' . $filename . '"'); |
|
| 268 | + header('Content-Disposition: attachment; filename="'.$filename.'"'); |
|
| 269 | 269 | } else { |
| 270 | - header('Content-Disposition: inline; filename="' . $filename . '"'); |
|
| 270 | + header('Content-Disposition: inline; filename="'.$filename.'"'); |
|
| 271 | 271 | } |
| 272 | - header('Content-Length: ' . dol_filesize($fullpath_original_file)); |
|
| 272 | + header('Content-Length: '.dol_filesize($fullpath_original_file)); |
|
| 273 | 273 | |
| 274 | 274 | readfile($fullpath_original_file_osencoded); |
| 275 | 275 | } |
@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php // BEGIN PHP |
| 2 | 2 | $websitekey = basename(__DIR__); |
| 3 | -if (! defined('USEDOLIBARRSERVER') && ! defined('USEDOLIBARREDITOR')) { require_once __DIR__ . '/master.inc.php'; |
|
| 3 | +if (!defined('USEDOLIBARRSERVER') && !defined('USEDOLIBARREDITOR')) { require_once __DIR__.'/master.inc.php'; |
|
| 4 | 4 | } // Load env if not already loaded |
| 5 | -require_once DOL_DOCUMENT_ROOT . '/core/lib/website.lib.php'; |
|
| 6 | -require_once DOL_DOCUMENT_ROOT . '/core/website.inc.php'; |
|
| 5 | +require_once DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; |
|
| 6 | +require_once DOL_DOCUMENT_ROOT.'/core/website.inc.php'; |
|
| 7 | 7 | ob_start(); |
| 8 | -if (! headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ |
|
| 8 | +if (!headers_sent()) { /* because file is included inline when in edit mode and we don't want warning */ |
|
| 9 | 9 | header('Cache-Control: max-age=3600, public, must-revalidate'); |
| 10 | 10 | header('Content-type: text/css'); |
| 11 | 11 | } |