|
@@ -23,7 +23,7 @@ class Article
|
|
if (strstr($data['content'], 'font-family:" hiragino="" sans="" gb","microsoft="" yahei","simsun";')) {
|
|
if (strstr($data['content'], 'font-family:" hiragino="" sans="" gb","microsoft="" yahei","simsun";')) {
|
|
$data['content'] = str_replace('font-family:" hiragino="" sans="" gb","microsoft="" yahei","simsun";', '', $data['content']);
|
|
$data['content'] = str_replace('font-family:" hiragino="" sans="" gb","microsoft="" yahei","simsun";', '', $data['content']);
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
if (strstr($data['content'], 'font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";')) {
|
|
if (strstr($data['content'], 'font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";')) {
|
|
$data['content'] = str_replace('font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";', '', $data['content']);
|
|
$data['content'] = str_replace('font-family:" gb","microsoft="" sans="" hiragino="" yahei","simsun";', '', $data['content']);
|
|
}
|
|
}
|
|
@@ -64,6 +64,10 @@ class Article
|
|
preg_match_all('/<p(.*?)>([\s]+)<img(.*?)data-id="(.*?)" data-key="(.*?)" \/>([\s]+)<\/p>/', $data['content'], $matches);
|
|
preg_match_all('/<p(.*?)>([\s]+)<img(.*?)data-id="(.*?)" data-key="(.*?)" \/>([\s]+)<\/p>/', $data['content'], $matches);
|
|
|
|
|
|
|
|
|
|
|
|
+ if (!isset($matches[4][0])) {
|
|
|
|
+ preg_match_all('/<p(.*?)>([\s]+)<img(.*?)data-key="(.*?)" data-id="(.*?)" \/>([\s]+)<\/p>/', $data['content'], $matches);
|
|
|
|
+ }
|
|
|
|
+
|
|
if (isset($matches[4][0]) && isset($matches[5][0])) {
|
|
if (isset($matches[4][0]) && isset($matches[5][0])) {
|
|
foreach ($matches[4] as $k => $v) {
|
|
foreach ($matches[4] as $k => $v) {
|
|
$content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);
|
|
$content = str_replace($matches[0][$k], '{replace}'.count($replace).'{replace}', $content);
|