* adjust code.

This commit is contained in:
wangyidong
2017-06-20 16:12:10 +08:00
parent f4608f5a6b
commit 5e46cb6fc5
+2 -2
View File
@@ -394,7 +394,7 @@ class fileModel extends model
$content = preg_replace('/ src="(' . $readLinkReg . ')" /', ' onload="setImageSize(this,' . $maxSize . ')" src="$1" ', $content);
preg_match_all('/ src="{([0-9]+)}" /', $content, $matchs);
if($matchs[1])
if(!empty($matchs[1]))
{
$files = $this->dao->select('id,extension')->from(TABLE_FILE)->where('id')->in($matchs[1])->fetchPairs('id', 'extension');
foreach($matchs[0] as $i => $match)
@@ -751,7 +751,7 @@ class fileModel extends model
{
if(empty($field) or empty($data->$field)) continue;
preg_match_all('/ src="{([0-9]+)}" /', $data->$field, $matchs);
if($matchs[1])
if(!empty($matchs[1]))
{
$files = $this->dao->select('id,extension')->from(TABLE_FILE)->where('id')->in($matchs[1])->fetchPairs('id', 'extension');
foreach($matchs[0] as $i => $match)