File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed
src/system/modules/file_access/classes Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,17 @@ public function run()
8585 // find the path in the database
8686 if ( ( $ objFile = \FilesModel::findByPath ( $ strFile ) ) !== null )
8787 {
88+ if ( $ objFile ->count () > 0 )
89+ {
90+ $ logMessage = 'FileAccess error: found multiple database entries for path | count: ' .$ objFile ->count ();
91+ while ( $ objFile ->next () )
92+ $ logMessage .= ' | ID: ' .$ objFile ->id .', path: ' .$ objFile ->path ;
93+ log_message ($ logMessage );
94+
95+ header ('HTTP/1.1 500 Internal Server Error ' );
96+ die ('Server error ' );
97+ }
98+
8899 // authenticate the frontend user
89100 \FrontendUser::getInstance ()->authenticate ();
90101
@@ -121,12 +132,15 @@ public function run()
121132 session_write_close ();
122133
123134 // Disable zlib.output_compression (see #6717)
124- ini_set ('zlib.output_compression ' , 'Off ' );
135+ @ ini_set ('zlib.output_compression ' , 'Off ' );
125136
126137 // Set headers
127138 header ('Content-Type: ' . $ objFile ->mime );
128139 header ('Content-Length: ' . $ objFile ->filesize );
129140
141+ // Disable maximum execution time
142+ @ini_set ('max_execution_time ' , 0 );
143+
130144 // Output the file
131145 readfile ( TL_ROOT . '/ ' . $ objFile ->path );
132146 }
You can’t perform that action at this time.
0 commit comments