Changeset 407
- Timestamp:
- 04/06/08 20:01:50 (5 years ago)
- Location:
- downloadDatabase/files/lib
- Files:
-
- 6 modified
-
acp/form/DownloadDBDataAddForm.class.php (modified) (5 diffs)
-
acp/form/DownloadDBDataEditForm.class.php (modified) (2 diffs)
-
form/DownloadDBAddDataForm.class.php (modified) (5 diffs)
-
form/DownloadDBEditDataForm.class.php (modified) (2 diffs)
-
page/DownloadDBDataPage.class.php (modified) (2 diffs)
-
page/DownloadDBFileDownloadPage.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
downloadDatabase/files/lib/acp/form/DownloadDBDataAddForm.class.php
r402 r407 65 65 if (isset($_POST['datum'])) $this->datum = intval($_POST['datum']); 66 66 if (isset($_POST['sortOrder'])) $this->sortOrder = intval($_POST['sortOrder']); 67 if (isset($_POST['supportThread'])) $this->supportThread = StringUtil::encodeHTML($_POST['supportThread']);67 if (isset($_POST['supportThread'])) $this->supportThread = escapeString($_POST['supportThread']); 68 68 if (isset($_POST['activ'])) $this->activ = intval($_POST['activ']); 69 69 // for File Upload … … 114 114 // import file 115 115 $this->dataID = DownloadDBDataEditor::createFile($this->upload['tmp_name'], $this->upload['name'], $this->upload['type'], 'upload'); 116 $this->groesse = FileUtil::formatFilesize($this->upload['size']);116 $this->groesse = $this->upload['size']; 117 117 } else { 118 118 throw new UserInputException('upload'); … … 156 156 'mimeType' => escapeString($this->mimeType), 157 157 'link' => StringUtil::encodeHTML($this->link), 158 'groesse' => $this->groesse,158 'groesse' => intval($this->groesse), 159 159 'downloads' => intval($this->downloads), 160 160 'userID' => intval($this->dldbUserID), … … 219 219 parent::assignVariables(); 220 220 221 $maxFileSize = WCF::getUser()->getPermission('user.dldb.maxFileSize'); 221 222 WCF::getTPL()->assign(array( 222 223 'katOptions' => $this->katOptions, … … 238 239 'supportThread' => $this->supportThread, 239 240 'activ' => $this->activ, 240 'action' => 'add' 241 'action' => 'add', 242 'previewExtensions' => DOWNLOADDB_ALLOWED_PREVIEW_EXT, 243 'fileExtensions' => DOWNLOADDB_ALLOWED_FILE_EXT, 244 'maxFileSize' => $maxFileSize 241 245 )); 242 246 } -
downloadDatabase/files/lib/acp/form/DownloadDBDataEditForm.class.php
r402 r407 121 121 $this->fileName = $this->upload['name']; 122 122 $this->mimeType = $this->upload['type']; 123 $this->groesse = FileUtil::formatFilesize($this->upload['size']);123 $this->groesse = $this->upload['size']; 124 124 if (StringUtil::indexOf($this->fileName, '.') !== false) { 125 125 $this->fileExtension = StringUtil::toLowerCase(StringUtil::substring($this->fileName, StringUtil::lastIndexOf($this->fileName, '.') + 1)); … … 138 138 'mimeType' => StringUtil::encodeHTML($this->mimeType), 139 139 'link' => $this->link, 140 'groesse' => $this->groesse,140 'groesse' => intval($this->groesse), 141 141 'downloads' => intval($this->downloads), 142 142 'userID' => intval($this->dldbUserID), -
downloadDatabase/files/lib/form/DownloadDBAddDataForm.class.php
r402 r407 74 74 if (isset($_POST['previewIMG'])) $this->previewIMG = StringUtil::encodeHTML($_POST['previewIMG']); 75 75 if (isset($_POST['sortOrder'])) $this->sortOrder = intval($_POST['sortOrder']); 76 if (isset($_POST['supportThread'])) $this->supportThread = StringUtil::encodeHTML($_POST['supportThread']);76 if (isset($_POST['supportThread'])) $this->supportThread = escapeString($_POST['supportThread']); 77 77 // for File Upload 78 78 if (isset($_FILES['upload'])) $this->upload = $_FILES['upload']; … … 112 112 // import upload file 113 113 $this->dataID = DownloadDBDataEditor::createFile($this->upload['tmp_name'], $this->upload['name'], $this->upload['type'], 'upload'); 114 $this->groesse = FileUtil::formatFilesize($this->upload['size']);114 $this->groesse = $this->upload['size']; 115 115 } else { 116 116 // no file to upload given … … 155 155 'mimeType' => escapeString($this->mimeType), 156 156 'link' => StringUtil::encodeHTML($this->link), 157 'groesse' => $this->groesse,157 'groesse' => intval($this->groesse), 158 158 'downloads' => intval($this->downloads), 159 159 'userID' => WCF::getUser()->userID, … … 238 238 WCF::getTPL()->assign('offlinemessage', DOWNLOADDB_OFFLINE_MESSAGE); 239 239 } else { 240 $maxFileSize = WCF::getUser()->getPermission('user.dldb.maxFileSize'); 240 241 WCF::getTPL()->assign(array( 241 242 'katID' => $this->katID, … … 256 257 'supportThread' => $this->supportThread, 257 258 'activ' => $this->activ, 258 'action' => 'add' 259 'action' => 'add', 260 'previewExtensions' => DOWNLOADDB_ALLOWED_PREVIEW_EXT, 261 'fileExtensions' => DOWNLOADDB_ALLOWED_FILE_EXT, 262 'maxFileSize' => $maxFileSize 259 263 )); 260 264 } -
downloadDatabase/files/lib/form/DownloadDBEditDataForm.class.php
r402 r407 159 159 $this->fileName = $this->upload['name']; 160 160 $this->mimeType = $this->upload['type']; 161 $this->groesse = FileUtil::formatFilesize($this->upload['size']);161 $this->groesse = $this->upload['size']; 162 162 } 163 163 if (StringUtil::indexOf($this->fileName, '.') !== false) { … … 176 176 'mimeType' => StringUtil::encodeHTML($this->mimeType), 177 177 'link' => $this->link, 178 'groesse' => $this->groesse,178 'groesse' => intval($this->groesse), 179 179 'downloads' => intval($this->downloads), 180 180 'userID' => intval($this->dldbUserID), -
downloadDatabase/files/lib/page/DownloadDBDataPage.class.php
r402 r407 86 86 if ($daten['dataID'] == $this->dataID && $daten['activ']) { 87 87 $daten['type'] = $this->setFileTypeIcon($daten['mimeType']); 88 $daten['groesse'] = FileUtil::formatFilesize($daten['groesse']); 88 89 $IDs = explode(',',$daten['groupcheck']); 89 90 $daten['canViewCat'] = false; … … 120 121 } 121 122 // Beschreibung zur Ausgabe anpassen (BBCode+Smilies) 122 $daten['name'] = StringUtil::unescape($this->getFormattedMessage($daten['name']));123 $daten['description'] = StringUtil::unescape($this->getFormattedMessage($daten['description']));123 $daten['name'] = $this->getFormattedMessage(StringUtil::unescape($daten['name'])); 124 $daten['description'] = $this->getFormattedMessage(StringUtil::unescape($daten['description'])); 124 125 require_once(WCF_DIR.'lib/data/message/bbcode/URLParser.class.php'); 125 126 // URLs wandeln zur formatierten Ausgabe 126 $daten['thread'] = $this->getFormattedMessage(URLParser::parse(StringUtil::decodeHTML( $daten['thread'])));127 $daten['thread'] = $this->getFormattedMessage(URLParser::parse(StringUtil::decodeHTML(StringUtil::unescape($daten['thread'])))); 127 128 $this->daten = $daten; 128 129 break; -
downloadDatabase/files/lib/page/DownloadDBFileDownloadPage.class.php
r402 r407 36 36 public function show() { 37 37 $this->readDaten(); 38 // Anzahl der Downloads erhöhen 39 $sql = "UPDATE wcf".WCF_N."_dldb_data 40 SET downloads = downloads + 1 41 WHERE `dataID` = ".$this->dataID; 42 $row = WCF::getDB()->registerShutdownUpdate($sql); 43 // reset cache 44 WCF::getCache()->clear(WCF_DIR.'cache/', 'cache.dldbData.php'); 38 45 if (!$this->fileName) { 39 $link = FileUtil::downloadFileFromHttp($this->link, 'DLDB_'.$this->dataID); 46 if (FileUtil::isURL($this->link)) { 47 HeaderUtil::redirect($this->link,false); 48 exit; 49 } else { 50 $geturl = new downloadDBDataEditor($this->dataID); 51 $link = FileUtil::getRealPath(RELATIVE_WCF_DIR.$geturl->getURL()); 40 52 $size = filesize($link); 41 53 $type = 'application/unknown'; 42 54 $name = StringUtil::toLowerCase(StringUtil::substring($this->link, StringUtil::lastIndexOf($this->link, '/') + 1)); 43 55 } 44 56 } else { 45 57 $geturl = new downloadDBDataEditor($this->dataID); … … 58 70 // Start Download 59 71 @readfile($link); 60 // Anzahl der Downloads erhöhen61 $sql = "UPDATE wcf".WCF_N."_dldb_data62 SET downloads = downloads + 163 WHERE `dataID` = ".$this->dataID;64 $row = WCF::getDB()->registerShutdownUpdate($sql);65 // reset cache66 WCF::getCache()->clear(WCF_DIR.'cache/', 'cache.dldbData.php');67 72 } 68 73
