Passed
Push — dependabot/github_actions/mdew... ( c3a877 )
by
unknown
07:27
created
websites/website_template-onepageblackpurple/containers/javascript.js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
websites/website_template-restaurant/containers/manifest.json.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
DocTemplates/websites/website_template-restaurant/containers/master.inc.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
DocTemplates/websites/website_template-restaurant/containers/wrapper.php 1 patch
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
DocTemplates/websites/website_template-restaurant/containers/styles.css.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -1,11 +1,11 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
websites/website_template-restaurant/containers/javascript.js.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
DocTemplates/websites/website_template-stellar/containers/manifest.json.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -1,9 +1,9 @@
 block discarded – undo
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');
Please login to merge, or discard this patch.
DocTemplates/websites/website_template-stellar/containers/master.inc.php 2 patches
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -2,6 +2,8 @@
 block discarded – undo
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
 }
Please login to merge, or discard this patch.
DocTemplates/websites/website_template-stellar/containers/wrapper.php 2 patches
Spacing   +33 added lines, -33 removed lines patch added patch discarded remove patch
@@ -8,7 +8,7 @@  discard block
 block discarded – undo
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
 
@@ -26,7 +26,7 @@  discard block
 block discarded – undo
26 26
 
27 27
 // If we have a hash public (hashp), we guess the original_file.
28 28
 if (!empty($hashp)) {
29
-    include_once DOL_DOCUMENT_ROOT . '/ecm/class/ecmfiles.class.php';
29
+    include_once DOL_DOCUMENT_ROOT.'/ecm/class/ecmfiles.class.php';
30 30
     $ecmfile = new EcmFiles($db);
31 31
     $result = $ecmfile->fetch(0, '', '', '', $hashp);
32 32
     if ($result > 0) {
@@ -40,14 +40,14 @@  discard block
 block discarded – undo
40 40
         if ($modulepart) {  // Not required, so often not defined, for link using public hashp parameter.
41 41
             if ($moduleparttocheck == $modulepart) {
42 42
                 // We remove first level of directory
43
-                $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir
43
+                $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
44 44
                 //var_dump($original_file); exit;
45 45
             } else {
46 46
                 print 'Bad link. File is from another module part.';
47 47
             }
48 48
         } else {
49 49
             $modulepart = $moduleparttocheck;
50
-            $original_file = (($tmp[1] ? $tmp[1] . '/' : '') . $ecmfile->filename); // this is relative to module dir
50
+            $original_file = (($tmp[1] ? $tmp[1].'/' : '').$ecmfile->filename); // this is relative to module dir
51 51
         }
52 52
     } else {
53 53
         print "ErrorFileNotFoundWithSharedLink";
@@ -77,7 +77,7 @@  discard block
 block discarded – undo
77 77
     header('Pragma: cache'); // This is to avoid having Pragma: no-cache
78 78
 }
79 79
 
80
-$refname = basename(dirname($original_file) . "/");
80
+$refname = basename(dirname($original_file)."/");
81 81
 
82 82
 // Get RSS news
83 83
 if ($rss) {
@@ -87,8 +87,8 @@  discard block
 block discarded – undo
87 87
     $filename = $original_file;
88 88
     $dir_temp = $conf->website->dir_temp;
89 89
 
90
-    include_once DOL_DOCUMENT_ROOT . '/website/class/website.class.php';
91
-    include_once DOL_DOCUMENT_ROOT . '/website/class/websitepage.class.php';
90
+    include_once DOL_DOCUMENT_ROOT.'/website/class/website.class.php';
91
+    include_once DOL_DOCUMENT_ROOT.'/website/class/websitepage.class.php';
92 92
     $website = new Website($db);
93 93
     $websitepage = new WebsitePage($db);
94 94
 
@@ -102,26 +102,26 @@  discard block
 block discarded – undo
102 102
     $eventarray = array();
103 103
     if (is_array($arrayofblogs)) {
104 104
         foreach ($arrayofblogs as $blog) {
105
-            $blog->fullpageurl = $website->virtualhost . '/' . $blog->pageurl . '.php';
105
+            $blog->fullpageurl = $website->virtualhost.'/'.$blog->pageurl.'.php';
106 106
             $eventarray[] = $blog;
107 107
         }
108 108
     }
109 109
 
110
-    require_once DOL_DOCUMENT_ROOT . "/core/lib/xcal.lib.php";
111
-    require_once DOL_DOCUMENT_ROOT . "/core/lib/date.lib.php";
112
-    require_once DOL_DOCUMENT_ROOT . "/core/lib/files.lib.php";
110
+    require_once DOL_DOCUMENT_ROOT."/core/lib/xcal.lib.php";
111
+    require_once DOL_DOCUMENT_ROOT."/core/lib/date.lib.php";
112
+    require_once DOL_DOCUMENT_ROOT."/core/lib/files.lib.php";
113 113
 
114
-    dol_syslog("build_exportfile Build export file format=" . $format . ", type=" . $type . ", cachedelay=" . $cachedelay . ", filename=" . $filename . ", filters size=" . count($filters), LOG_DEBUG);
114
+    dol_syslog("build_exportfile Build export file format=".$format.", type=".$type.", cachedelay=".$cachedelay.", filename=".$filename.", filters size=".count($filters), LOG_DEBUG);
115 115
 
116 116
     // Clean parameters
117 117
     if (!$filename) {
118 118
         $extension = 'rss';
119
-        $filename = $format . '.' . $extension;
119
+        $filename = $format.'.'.$extension;
120 120
     }
121 121
 
122 122
     // Create dir and define output file (definitive and temporary)
123 123
     $result = dol_mkdir($dir_temp);
124
-    $outputfile = $dir_temp . '/' . $filename;
124
+    $outputfile = $dir_temp.'/'.$filename;
125 125
 
126 126
     $result = 0;
127 127
 
@@ -129,9 +129,9 @@  discard block
 block discarded – undo
129 129
 
130 130
     if ($cachedelay) {
131 131
         $nowgmt = dol_now();
132
-        include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
132
+        include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
133 133
         if (dol_filemtime($outputfile) > ($nowgmt - $cachedelay)) {
134
-            dol_syslog("build_exportfile file " . $outputfile . " is not older than now - cachedelay (" . $nowgmt . " - " . $cachedelay . "). Build is canceled");
134
+            dol_syslog("build_exportfile file ".$outputfile." is not older than now - cachedelay (".$nowgmt." - ".$cachedelay."). Build is canceled");
135 135
             $buildfile = false;
136 136
         }
137 137
     }
@@ -145,19 +145,19 @@  discard block
 block discarded – undo
145 145
         dolChmod($outputfiletmp);
146 146
 
147 147
         // Write file
148
-        $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost . '/wrapper.php?rss=1' . ($l ? '&l=' . $l : ''), $l);
148
+        $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost.'/wrapper.php?rss=1'.($l ? '&l='.$l : ''), $l);
149 149
 
150 150
         if ($result >= 0) {
151 151
             if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) $result = 1;
152 152
             else {
153
-                $error = 'Failed to rename ' . $outputfiletmp . ' into ' . $outputfile;
154
-                dol_syslog("build_exportfile " . $error, LOG_ERR);
153
+                $error = 'Failed to rename '.$outputfiletmp.' into '.$outputfile;
154
+                dol_syslog("build_exportfile ".$error, LOG_ERR);
155 155
                 dol_delete_file($outputfiletmp, 0, 1);
156 156
                 print $error;
157 157
                 exit(-1);
158 158
             }
159 159
         } else {
160
-            dol_syslog("build_exportfile build_xxxfile function fails to for format=" . $format . " outputfiletmp=" . $outputfile, LOG_ERR);
160
+            dol_syslog("build_exportfile build_xxxfile function fails to for format=".$format." outputfiletmp=".$outputfile, LOG_ERR);
161 161
             dol_delete_file($outputfiletmp, 0, 1);
162 162
             $langs->load("errors");
163 163
             print $langs->trans("ErrorFailToCreateFile", $outputfile);
@@ -174,29 +174,29 @@  discard block
 block discarded – undo
174 174
         //$contenttype='text/plain';
175 175
         $outputencoding = 'UTF-8';
176 176
 
177
-        if ($contenttype)       header('Content-Type: ' . $contenttype . ($outputencoding ? '; charset=' . $outputencoding : ''));
178
-        if ($attachment)        header('Content-Disposition: attachment; filename="' . $filename . '"');
177
+        if ($contenttype)       header('Content-Type: '.$contenttype.($outputencoding ? '; charset='.$outputencoding : ''));
178
+        if ($attachment)        header('Content-Disposition: attachment; filename="'.$filename.'"');
179 179
 
180 180
         // Ajout directives pour resoudre bug IE
181 181
         //header('Cache-Control: Public, must-revalidate');
182 182
         //header('Pragma: public');
183
-        if ($cachedelay) header('Cache-Control: max-age=' . $cachedelay . ', private, must-revalidate');
183
+        if ($cachedelay) header('Cache-Control: max-age='.$cachedelay.', private, must-revalidate');
184 184
         else header('Cache-Control: private, must-revalidate');
185 185
 
186 186
         // Clean parameters
187
-        $outputfile = $dir_temp . '/' . $filename;
187
+        $outputfile = $dir_temp.'/'.$filename;
188 188
         $result = readfile($outputfile);
189
-        if (!$result) print 'File ' . $outputfile . ' was empty.';
189
+        if (!$result) print 'File '.$outputfile.' was empty.';
190 190
 
191 191
         // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
192 192
         exit;
193 193
     }
194 194
 } elseif ($modulepart == "mycompany" && preg_match('/^\/?logos\//', $original_file)) {
195 195
     // Get logos
196
-    readfile(dol_osencode($conf->mycompany->dir_output . "/" . $original_file));
196
+    readfile(dol_osencode($conf->mycompany->dir_output."/".$original_file));
197 197
 } else {
198 198
     // Find the subdirectory name as the reference
199
-    include_once DOL_DOCUMENT_ROOT . '/core/lib/files.lib.php';
199
+    include_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
200 200
     $check_access = dol_check_secure_access_document($modulepart, $original_file, $entity, null, $refname);
201 201
     $accessallowed              = empty($check_access['accessallowed']) ? '' : $check_access['accessallowed'];
202 202
     $sqlprotectagainstexternals = empty($check_access['sqlprotectagainstexternals']) ? '' : $check_access['sqlprotectagainstexternals'];
@@ -223,19 +223,19 @@  discard block
 block discarded – undo
223 223
 
224 224
     // This test if file exists should be useless. We keep it to find bug more easily
225 225
     if (!file_exists($fullpath_original_file_osencoded)) {
226
-        print "ErrorFileDoesNotExists: " . dol_escape_htmltag($original_file);
226
+        print "ErrorFileDoesNotExists: ".dol_escape_htmltag($original_file);
227 227
         exit;
228 228
     }
229 229
 
230 230
     // Permissions are ok and file found, so we return it
231 231
     //top_httphead($type);
232
-    header('Content-Type: ' . $type);
232
+    header('Content-Type: '.$type);
233 233
     header('Content-Description: File Transfer');
234
-    if ($encoding)   header('Content-Encoding: ' . $encoding);
234
+    if ($encoding)   header('Content-Encoding: '.$encoding);
235 235
     // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open)
236
-    if ($attachment) header('Content-Disposition: attachment; filename="' . $filename . '"');
237
-    else header('Content-Disposition: inline; filename="' . $filename . '"');
238
-    header('Content-Length: ' . dol_filesize($fullpath_original_file));
236
+    if ($attachment) header('Content-Disposition: attachment; filename="'.$filename.'"');
237
+    else header('Content-Disposition: inline; filename="'.$filename.'"');
238
+    header('Content-Length: '.dol_filesize($fullpath_original_file));
239 239
 
240 240
     readfile($fullpath_original_file_osencoded);
241 241
 }
Please login to merge, or discard this patch.
Braces   +54 added lines, -20 removed lines patch added patch discarded remove patch
@@ -22,7 +22,9 @@  discard block
 block discarded – undo
22 22
 
23 23
 // Parameters for RSS
24 24
 $rss = GETPOST('rss', 'aZ09');
25
-if ($rss) $original_file = 'blog.rss';
25
+if ($rss) {
26
+    $original_file = 'blog.rss';
27
+}
26 28
 
27 29
 // If we have a hash public (hashp), we guess the original_file.
28 30
 if (!empty($hashp)) {
@@ -57,14 +59,23 @@  discard block
 block discarded – undo
57 59
 
58 60
 // Define attachment (attachment=true to force choice popup 'open'/'save as')
59 61
 $attachment = true;
60
-if (preg_match('/\.(html|htm)$/i', $original_file)) $attachment = false;
61
-if (isset($_GET["attachment"])) $attachment = (GETPOST("attachment", 'alphanohtml') ? true : false);
62
-if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS_WEBSITE)) $attachment = false;
62
+if (preg_match('/\.(html|htm)$/i', $original_file)) {
63
+    $attachment = false;
64
+}
65
+if (isset($_GET["attachment"])) {
66
+    $attachment = (GETPOST("attachment", 'alphanohtml') ? true : false);
67
+}
68
+if (!empty($conf->global->MAIN_DISABLE_FORCE_SAVEAS_WEBSITE)) {
69
+    $attachment = false;
70
+}
63 71
 
64 72
 // Define mime type
65 73
 $type = 'application/octet-stream';
66
-if (GETPOSTISSET('type')) $type = GETPOST('type', 'alpha');
67
-else $type = dol_mimetype($original_file);
74
+if (GETPOSTISSET('type')) {
75
+    $type = GETPOST('type', 'alpha');
76
+} else {
77
+    $type = dol_mimetype($original_file);
78
+}
68 79
 
69 80
 // Security: Delete string ../ into $original_file
70 81
 $original_file = str_replace("../", "/", $original_file);
@@ -95,7 +106,9 @@  discard block
 block discarded – undo
95 106
     $website->fetch('', $websitekey);
96 107
 
97 108
     $filters = array('type_container' => 'blogpost');
98
-    if ($l) $filters['lang'] = $l;
109
+    if ($l) {
110
+        $filters['lang'] = $l;
111
+    }
99 112
 
100 113
     $MAXNEWS = ($limit ? $limit : 20);
101 114
     $arrayofblogs = $websitepage->fetchAll($website->id, 'DESC', 'date_creation', $MAXNEWS, 0, $filters);
@@ -148,8 +161,9 @@  discard block
 block discarded – undo
148 161
         $result = build_rssfile($format, $title, $desc, $eventarray, $outputfiletmp, '', $website->virtualhost . '/wrapper.php?rss=1' . ($l ? '&l=' . $l : ''), $l);
149 162
 
150 163
         if ($result >= 0) {
151
-            if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) $result = 1;
152
-            else {
164
+            if (dol_move($outputfiletmp, $outputfile, 0, 1, 0, 0)) {
165
+                $result = 1;
166
+            } else {
153 167
                 $error = 'Failed to rename ' . $outputfiletmp . ' into ' . $outputfile;
154 168
                 dol_syslog("build_exportfile " . $error, LOG_ERR);
155 169
                 dol_delete_file($outputfiletmp, 0, 1);
@@ -167,26 +181,39 @@  discard block
 block discarded – undo
167 181
 
168 182
     if ($result >= 0) {
169 183
         $attachment = false;
170
-        if (isset($_GET["attachment"])) $attachment = $_GET["attachment"];
184
+        if (isset($_GET["attachment"])) {
185
+            $attachment = $_GET["attachment"];
186
+        }
171 187
         //$attachment = false;
172 188
         $contenttype = 'application/rss+xml';
173
-        if (isset($_GET["contenttype"])) $contenttype = $_GET["contenttype"];
189
+        if (isset($_GET["contenttype"])) {
190
+            $contenttype = $_GET["contenttype"];
191
+        }
174 192
         //$contenttype='text/plain';
175 193
         $outputencoding = 'UTF-8';
176 194
 
177
-        if ($contenttype)       header('Content-Type: ' . $contenttype . ($outputencoding ? '; charset=' . $outputencoding : ''));
178
-        if ($attachment)        header('Content-Disposition: attachment; filename="' . $filename . '"');
195
+        if ($contenttype) {
196
+            header('Content-Type: ' . $contenttype . ($outputencoding ? '; charset=' . $outputencoding : ''));
197
+        }
198
+        if ($attachment) {
199
+            header('Content-Disposition: attachment; filename="' . $filename . '"');
200
+        }
179 201
 
180 202
         // Ajout directives pour resoudre bug IE
181 203
         //header('Cache-Control: Public, must-revalidate');
182 204
         //header('Pragma: public');
183
-        if ($cachedelay) header('Cache-Control: max-age=' . $cachedelay . ', private, must-revalidate');
184
-        else header('Cache-Control: private, must-revalidate');
205
+        if ($cachedelay) {
206
+            header('Cache-Control: max-age=' . $cachedelay . ', private, must-revalidate');
207
+        } else {
208
+            header('Cache-Control: private, must-revalidate');
209
+        }
185 210
 
186 211
         // Clean parameters
187 212
         $outputfile = $dir_temp . '/' . $filename;
188 213
         $result = readfile($outputfile);
189
-        if (!$result) print 'File ' . $outputfile . ' was empty.';
214
+        if (!$result) {
215
+            print 'File ' . $outputfile . ' was empty.';
216
+        }
190 217
 
191 218
         // header("Location: ".DOL_URL_ROOT.'/document.php?modulepart=agenda&file='.urlencode($filename));
192 219
         exit;
@@ -231,13 +258,20 @@  discard block
 block discarded – undo
231 258
     //top_httphead($type);
232 259
     header('Content-Type: ' . $type);
233 260
     header('Content-Description: File Transfer');
234
-    if ($encoding)   header('Content-Encoding: ' . $encoding);
261
+    if ($encoding) {
262
+        header('Content-Encoding: ' . $encoding);
263
+    }
235 264
     // Add MIME Content-Disposition from RFC 2183 (inline=automatically displayed, attachment=need user action to open)
236
-    if ($attachment) header('Content-Disposition: attachment; filename="' . $filename . '"');
237
-    else header('Content-Disposition: inline; filename="' . $filename . '"');
265
+    if ($attachment) {
266
+        header('Content-Disposition: attachment; filename="' . $filename . '"');
267
+    } else {
268
+        header('Content-Disposition: inline; filename="' . $filename . '"');
269
+    }
238 270
     header('Content-Length: ' . dol_filesize($fullpath_original_file));
239 271
 
240 272
     readfile($fullpath_original_file_osencoded);
241 273
 }
242
-if (is_object($db)) $db->close();
274
+if (is_object($db)) {
275
+    $db->close();
276
+}
243 277
 // END PHP
Please login to merge, or discard this patch.