紀錄:

問題一、編輯產品資料 選擇產品圖片無法儲存上傳成功

修正辦法:修改PHP

修改檔案: vtlib/Vtiger/Functions.php

修改內容:

搜尋 → static function validateImage($file_details) {}

內容整段替換入如下:

static function validateImage($file_details) {

global $app_strings;

$allowedImageFormats = array('jpeg', 'png', 'jpg', 'pjpeg', 'x-png', 'gif', 'bmp');

 

$mimeTypesList = array_merge($allowedImageFormats, array('x-ms-bmp'));//bmp another format

$file_type_details = explode("/", $file_details['type']);

$filetype = $file_type_details['1'];

if ($filetype) {

$filetype = strtolower($filetype);

}

 

$saveimage = 'true';

if (!in_array($filetype, $allowedImageFormats)) {

$saveimage = 'false';

}

 

//mime type check

$mimeType = mime_content_type($file_details['tmp_name']);

$mimeTypeContents = explode('/', $mimeType);

if (!$file_details['size'] || !in_array($mimeTypeContents[1], $mimeTypesList)) {

$saveimage = 'false';

}

 

// Check for php code injection

$imageContents = file_get_contents($file_details['tmp_name']);

if (preg_match('/(<\?php?(.*?))/i', $imageContents) == 1) {

$saveimage = 'false';

}

return $saveimage;

}

問題二、產品圖片顯示不正確

修正辦法:修改CSS

修改檔案:/layouts/v7/skins/sales/style.css (另有提供:/layouts/vt7/skins/inventory/style.css)

修正內容:

.bx-wrapper img {
  max-width: 100%;
  width: 500px;
  height: 45px; →→ height: 100%;
  
}

創作者介紹
創作者 Kuma 熊本部 的頭像
KumaChen

Kuma 熊本部

KumaChen 發表在 痞客邦 留言(0) 人氣( 17 )