public static function upload_zip($v86536e21993c5a96a4d4c9c9afcc9b17, $v8c7dd922ad47494fc02c388e12c00eac = "", $v851148b4fd8fd7ae74bd9100c5c0c898 = "./images/cms/data/", $v043f01e8ecc376fc15ecb17504a1f05e = false) { if ($v8c7dd922ad47494fc02c388e12c00eac == "") { $ve440be6a92dba11caa790215081671ae = $v86536e21993c5a96a4d4c9c9afcc9b17['tmp_name']; $vb068931cc450442b63f5b3d276ea4297 = $v86536e21993c5a96a4d4c9c9afcc9b17['name']; list(, , $v566bbee0f961ad71b54c3c2fd36db053) = array_values(getPathInfo($vb068931cc450442b63f5b3d276ea4297)); $vb068931cc450442b63f5b3d276ea4297 = substr($vb068931cc450442b63f5b3d276ea4297, 0, strlen($vb068931cc450442b63f5b3d276ea4297) - strlen($v566bbee0f961ad71b54c3c2fd36db053)); $vb068931cc450442b63f5b3d276ea4297 = translit::convert($vb068931cc450442b63f5b3d276ea4297); $vb068931cc450442b63f5b3d276ea4297 .= "." . $v566bbee0f961ad71b54c3c2fd36db053; $v9024b204fb4c4ffdd07ee631ed791f75 = $v851148b4fd8fd7ae74bd9100c5c0c898 . $vb068931cc450442b63f5b3d276ea4297; $v51b7b5d0a5d6f26dc31ce613f4966356 = CURRENT_WORKING_DIR . "/sys-temp/uploads"; if (!is_dir($v51b7b5d0a5d6f26dc31ce613f4966356)) { mkdir($v51b7b5d0a5d6f26dc31ce613f4966356); } $v3cc7992a6d5b20ce784f6169f4423048 = $v51b7b5d0a5d6f26dc31ce613f4966356 . '/' . $vb068931cc450442b63f5b3d276ea4297; if ($v86536e21993c5a96a4d4c9c9afcc9b17['size'] == 0) { return false; } if (is_uploaded_file($ve440be6a92dba11caa790215081671ae)) { $v9024b204fb4c4ffdd07ee631ed791f75 = umiFile::getUnconflictPath($v9024b204fb4c4ffdd07ee631ed791f75); if (move_uploaded_file($ve440be6a92dba11caa790215081671ae, $v3cc7992a6d5b20ce784f6169f4423048)) { chmod($v3cc7992a6d5b20ce784f6169f4423048, self::$mask); } else { return false; } } else { return false; } } else { $v8c7dd922ad47494fc02c388e12c00eac = CURRENT_WORKING_DIR . "/" . $v8c7dd922ad47494fc02c388e12c00eac; if (!file_exists($v8c7dd922ad47494fc02c388e12c00eac) || !is_writable($v8c7dd922ad47494fc02c388e12c00eac)) { return "File not exists!"; } $ve6223bee17b330d9aed62e68463e0515 = getPathInfo($v8c7dd922ad47494fc02c388e12c00eac); if ($ve6223bee17b330d9aed62e68463e0515['extension'] != "zip") { return "It's not zip-file!"; } $v9024b204fb4c4ffdd07ee631ed791f75 = $v8c7dd922ad47494fc02c388e12c00eac; $v3cc7992a6d5b20ce784f6169f4423048 = $v8c7dd922ad47494fc02c388e12c00eac; } $vcedff02a1ddad18efd0b59b7b09e0eb5 = self::$addWaterMark; self::$addWaterMark = $v043f01e8ecc376fc15ecb17504a1f05e; $v888d0ee361af3603736f32131e7b20a2 = new PclZip($v3cc7992a6d5b20ce784f6169f4423048); $v10ae9fc7d453b0dd525d0edf2ede7961 = $v888d0ee361af3603736f32131e7b20a2->listContent(); if (count($v10ae9fc7d453b0dd525d0edf2ede7961) < 1) { throw new publicAdminException(getLabel('zip-file-empty')); } $v79001f389eb5f5185f6945430cb57be1 = cmsController::getInstance()->getModule('data')->getAllowedMaxFileSize(); $ve6a7ab42343e8bc9131d89646abcb773 = regedit::getInstance()->getVal("//settings/max_img_filesize"); if (!$ve6a7ab42343e8bc9131d89646abcb773) { $ve6a7ab42343e8bc9131d89646abcb773 = $v79001f389eb5f5185f6945430cb57be1; } $ve6a7ab42343e8bc9131d89646abcb773 = $ve6a7ab42343e8bc9131d89646abcb773 * 1024 * 1024; $va80da1282f2c775bbc5f2c92c836968b = 0; foreach ($v10ae9fc7d453b0dd525d0edf2ede7961 as $v3c6e0b8a9c15224a8228b9a98ca1531d => $v8a8e67a18097123aaa2495f5465224da) { $v566bbee0f961ad71b54c3c2fd36db053 = strtolower(preg_replace('/^[^.]*\\./', '', $v8a8e67a18097123aaa2495f5465224da['filename'])); if (!umiFile::isAllowedImageType($v566bbee0f961ad71b54c3c2fd36db053)) { unset($v10ae9fc7d453b0dd525d0edf2ede7961[$v3c6e0b8a9c15224a8228b9a98ca1531d]); continue; } if ($v8a8e67a18097123aaa2495f5465224da['size'] > $ve6a7ab42343e8bc9131d89646abcb773) { throw new publicAdminException(getLabel('zip-file-image-max-size') . "{$v8a8e67a18097123aaa2495f5465224da['filename']}"); } $va80da1282f2c775bbc5f2c92c836968b += $v8a8e67a18097123aaa2495f5465224da['size']; } if (count($v10ae9fc7d453b0dd525d0edf2ede7961) < 1) { throw new publicAdminException(getLabel('zip-file-images-absent')); } if (!checkAllowedDiskSize($va80da1282f2c775bbc5f2c92c836968b)) { throw new publicAdminException(getLabel('zip-file-images-no-free-size')); } $v10ae9fc7d453b0dd525d0edf2ede7961 = $v888d0ee361af3603736f32131e7b20a2->extract(PCLZIP_OPT_PATH, $v851148b4fd8fd7ae74bd9100c5c0c898, PCLZIP_CB_PRE_EXTRACT, "callbackPreExtract", PCLZIP_CB_POST_EXTRACT, "callbackPostExtract", PCLZIP_OPT_REMOVE_ALL_PATH); self::$addWaterMark = $vcedff02a1ddad18efd0b59b7b09e0eb5; if (!is_array($v10ae9fc7d453b0dd525d0edf2ede7961)) { throw new coreException("Zip extracting error: " . $v888d0ee361af3603736f32131e7b20a2->errorInfo(true)); } if (is_writable($v3cc7992a6d5b20ce784f6169f4423048)) { unlink($v3cc7992a6d5b20ce784f6169f4423048); } return $v10ae9fc7d453b0dd525d0edf2ede7961; }