Commit 5271a343d75d41446ae64b9caffaadd7c1372ddd
1 parent
0f335ffe
KTS-1784
"trying to upload excel document and this is making KT crash" Fixed. Added range limiting. KTS-1714 "Unable to upload only xls document" Fixed. Added range limiting. Committed By: Kevin Reviewed By: Conrad git-svn-id: https://kt-dms.svn.sourceforge.net/svnroot/kt-dms/STABLE/trunk@6680 c91229c3-7414-0410-bfa2-8a42b809f60b
Showing
1 changed file
with
8 additions
and
8 deletions
plugins/ktstandard/contents/ExcelIndexer.php
| ... | ... | @@ -61,16 +61,16 @@ class KTExcelIndexerTrigger extends KTBaseIndexerTrigger { |
| 61 | 61 | $reader = new Spreadsheet_Excel_Reader(); |
| 62 | 62 | $reader->setOutputEncoding('UTF-8'); |
| 63 | 63 | $reader->read($sFilename); |
| 64 | - | |
| 64 | + | |
| 65 | 65 | $t = fopen($sTempFilename, "w"); |
| 66 | 66 | foreach ($reader->sheets as $aSheet) { |
| 67 | - for ($i = 1; $i <= $aSheet['numRows']; $i++) { | |
| 68 | - for ($j = 1; $j <= $aSheet['numCols']; $j++) { | |
| 69 | - fwrite($t, $aSheet['cells'][$i][$j] . " "); | |
| 70 | - } | |
| 71 | - fwrite($t, "\n"); | |
| 72 | - } | |
| 73 | - fwrite($t, "\n\n\n"); | |
| 67 | + for ($i = 1; $i <= $aSheet['numRows'] && $i <= 1000; $i++) { | |
| 68 | + for ($j = 1; $j <= $aSheet['numCols'] && $j <= 1000; $j++) { | |
| 69 | + fwrite($t, $aSheet['cells'][$i][$j] . " "); | |
| 70 | + } | |
| 71 | + fwrite($t, "\n"); | |
| 72 | + } | |
| 73 | + fwrite($t, "\n\n\n"); | |
| 74 | 74 | } |
| 75 | 75 | fclose($t); |
| 76 | 76 | return file_get_contents($sTempFilename); | ... | ... |