|
@@ -741,7 +741,7 @@ function del_share_images()
|
|
|
|
|
|
foreach ($files as $file)
|
|
foreach ($files as $file)
|
|
{
|
|
{
|
|
- if (in_array($file, array('.','..'))) {
|
|
|
|
|
|
+ if (in_array($file, ['.','..'])) {
|
|
continue;
|
|
continue;
|
|
}
|
|
}
|
|
@unlink($share_image_cache_path. $file);
|
|
@unlink($share_image_cache_path. $file);
|
|
@@ -823,7 +823,7 @@ function subdomain(){
|
|
if(empty($line) || strtolower($line) == 'www') return 0;
|
|
if(empty($line) || strtolower($line) == 'www') return 0;
|
|
|
|
|
|
$model_store = Model('store');
|
|
$model_store = Model('store');
|
|
- $store_info = $model_store->getStoreInfo(array('store_domain'=>$line));
|
|
|
|
|
|
+ $store_info = $model_store->getStoreInfo(['store_domain'=>$line]);
|
|
//二级域名存在
|
|
//二级域名存在
|
|
if ($store_info['store_id'] > 0){
|
|
if ($store_info['store_id'] > 0){
|
|
$store_id = $store_info['store_id'];
|
|
$store_id = $store_info['store_id'];
|
|
@@ -857,7 +857,7 @@ function ncReplaceText($message,$param){
|
|
*/
|
|
*/
|
|
function str_cut($string, $length, $dot = '')
|
|
function str_cut($string, $length, $dot = '')
|
|
{
|
|
{
|
|
- $string = str_replace(array(' ', '&', '"', ''', '“', '”', '—', '<', '>', '·', '…'), array(' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'), $string);
|
|
|
|
|
|
+ $string = str_replace([' ', '&', '"', ''', '“', '”', '—', '<', '>', '·', '…'], [' ', '&', '"', "'", '“', '”', '—', '<', '>', '·', '…'], $string);
|
|
$strlen = strlen($string);
|
|
$strlen = strlen($string);
|
|
if($strlen <= $length) return $string;
|
|
if($strlen <= $length) return $string;
|
|
$maxi = $length - strlen($dot);
|
|
$maxi = $length - strlen($dot);
|
|
@@ -897,7 +897,7 @@ function str_cut($string, $length, $dot = '')
|
|
$strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i];
|
|
$strcut .= ord($string[$i]) > 127 ? $string[$i].$string[++$i] : $string[$i];
|
|
}
|
|
}
|
|
}
|
|
}
|
|
- $strcut = str_replace(array('&', '"', "'", '<', '>'), array('&', '"', ''', '<', '>'), $strcut);
|
|
|
|
|
|
+ $strcut = str_replace(['&', '"', "'", '<', '>'], ['&', '"', ''', '<', '>'], $strcut);
|
|
return $strcut.$dot;
|
|
return $strcut.$dot;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1120,7 +1120,7 @@ function getCMSArticleImageUrl($image_path, $image_name, $type='list') {
|
|
if(!empty($image_array['path'])) {
|
|
if(!empty($image_array['path'])) {
|
|
$image_path = $image_array['path'];
|
|
$image_path = $image_array['path'];
|
|
}
|
|
}
|
|
- $ext_array = array('list','max');
|
|
|
|
|
|
+ $ext_array = ['list','max'];
|
|
$file_path = ATTACH_CMS.DS.'article'.DS.$image_path.DS.str_ireplace('.', '_'.$type.'.', $image_name);
|
|
$file_path = ATTACH_CMS.DS.'article'.DS.$image_path.DS.str_ireplace('.', '_'.$type.'.', $image_name);
|
|
if(file_exists(BASE_PATH.DS.$file_name)) {
|
|
if(file_exists(BASE_PATH.DS.$file_name)) {
|
|
$image_name = UPLOAD_SITE_URL.DS.$file_path;
|
|
$image_name = UPLOAD_SITE_URL.DS.$file_path;
|