diff --git a/src/system/common.func.php b/src/system/common.func.php index 0387fba3..6102a373 100755 --- a/src/system/common.func.php +++ b/src/system/common.func.php @@ -93,9 +93,6 @@ function dede_random_bytes($length) return FALSE; } } - if (defined('MCRYPT_DEV_URANDOM') && ($output = mcrypt_create_iv($length, MCRYPT_DEV_URANDOM)) !== FALSE) { - return $output; - } if (is_readable('/dev/urandom') && ($fp = fopen('/dev/urandom', 'rb')) !== FALSE) { version_compare(PHP_VERSION, '5.4.0', '>=') && stream_set_chunk_size($fp, $length); $output = fread($fp, $length); @@ -322,7 +319,7 @@ function string_filter($str,$stype="inject") { return $str; } //载入自定义表单,用于发布 -function AddFilter($channelid, $type=1, $fieldsnamef=array(), $defaulttid=0, $loadtype='autofield') +function AddFilter($channelid, $type=1, $fieldsnamef="", $defaulttid=0, $loadtype='autofield') { global $tid,$dsql,$id; $tid = $defaulttid ? $defaulttid : $tid; diff --git a/src/system/dedecollection.func.php b/src/system/dedecollection.func.php index a4a85b4c..4a8be742 100755 --- a/src/system/dedecollection.func.php +++ b/src/system/dedecollection.func.php @@ -185,36 +185,7 @@ function GetHostInfo($gurl) $garr['query'] = "/".preg_replace("/^([^\/]*)\//i", "", $gurl); return $garr; } -/** - * HTML里的图片转DEDE格式 - * - * @access public - * @param string $body 文章内容 - * @return string - */ -function TurnImageTag(&$body) -{ - global $cfg_album_width, $cfg_ddimg_width; - if (empty($cfg_album_width)) { - $cfg_album_width = 800; - } - if (empty($cfg_ddimg_width)) { - $cfg_ddimg_width = 150; - } - $patten = "/<\\s*img\\s.*?src\\s*=\\s*([\"\\'])?(?(1)(.*?)\\1|([^\\s\\>\"\\']+))/isx"; - preg_match_all($patten, $body, $images); - $returnArray1 = $images[2]; - $returnArray2 = $images[3]; - foreach ($returnArray1 as $key => $value) { - if ($value) { - $ttx .= "{dede:img ddimg='$litpicname' text='图 ".($key + 1)."'}".$value."{/dede:img}"."\r\n"; - } else { - $ttx .= "{dede:img ddimg='$litpicname' text='图 ".($key + 1)."'}".$returnArray2[$key]."{/dede:img}"."\r\n"; - } - } - $ttx = "\r\n{dede:pagestyle maxwidth='{$cfg_album_width}' ddmaxwidth='{$cfg_ddimg_width}' row='3' col='3' value='2'/}\r\n{dede:comments}图集类型会采集时生成此配置是正常的,不过如果后面没有跟着img标记则表示规则无效{/dede:comments}\r\n".$ttx; - return $ttx; -} + /** * HTML里的网址格式转换 * diff --git a/src/system/dedetemplate.class.php b/src/system/dedetemplate.class.php index 68a172ad..f95e83df 100755 --- a/src/system/dedetemplate.class.php +++ b/src/system/dedetemplate.class.php @@ -51,7 +51,7 @@ function MakePublicTag($atts = array(), $refObj = '', $fields = array()) * @param array $attlist 属性列表 * @return void */ -function FillAtts(&$atts, $attlist) +function FillAtts(&$atts, $attlist="") { $attlists = explode(',', $attlist); foreach ($attlists as $att) { @@ -889,7 +889,7 @@ class DedeTemplate } else if (preg_match("/^value/", $vartype)) { $okvalue = '$'.$vartype; } else if ($vartype == 'field') { - $okvalue = '$'.str_replace($varname); + $okvalue = '$fields[\''.trim($varname).'\']'; } else { $okvalue = '$GLOBALS[\''.$varname.'\']'; } diff --git a/src/system/image.class.php b/src/system/image.class.php index 68f2d448..85fe5d8a 100755 --- a/src/system/image.class.php +++ b/src/system/image.class.php @@ -76,7 +76,8 @@ class image { $this->thumb_gd($thumbwidth, $thumbheight, $preview); if ($this->thumbstatus == 2 && $this->watermarkstatus) { - $this->image($this->targetfile, $this->attach); + $this->image($this->targetfile, $this->attach,$this->watermarktext,$this->watermarkstatus,$this->watermarktrans,$this->watermarkminheight + ,$this->watermarkminwidth,$this->watermarktype,$this->watermarktrans,true,$this->attach); $this->attach['size'] = filesize($this->targetfile); } }