浏览代码

modify google photo egrep pattern

miles 9 年之前
父节点
当前提交
bc018ad5ce
共有 1 个文件被更改,包括 2 次插入1 次删除
  1. 2 1
      functions.php

+ 2 - 1
functions.php

@@ -635,7 +635,8 @@ function replace_pic($content){
 			$content = apply_filters( 'the_content', $content);
 			$content = apply_filters( 'the_content', $content);
 			$content = str_replace( ']]>', ']]>', $content );
 			$content = str_replace( ']]>', ']]>', $content );
 				
 				
-			$pattern_1 = "/(http|https)\:\/\/\S+(googleusercontent|ggpht)\S+\/s(?<size>\d+)[\-c]*?\/\S+\.(jpg|png|gif)/i";
+			//$pattern_1 = "/(http|https)\:\/\/\S+(googleusercontent|ggpht)\S+\/s(?<size>\d+)[\-c]*?\/\S+\.(jpg|png|gif)/i";
+			$pattern_1 = "/(http|https)\:\/\/\S+(googleusercontent|ggpht)\S+\/s(?<size>\d+)[\-\S+]*?\/\S+\.(jpg|png|gif)/i";
 			$pattern_2 = "/(http|https)\:\/\/\S+(googleusercontent|ggpht)\S+\.(jpg|png|gif)\?imgmax=(?<size>\d+)/i";
 			$pattern_2 = "/(http|https)\:\/\/\S+(googleusercontent|ggpht)\S+\.(jpg|png|gif)\?imgmax=(?<size>\d+)/i";
 			
 			
 			$content = preg_replace_callback($pattern_1, 'replace', $content);
 			$content = preg_replace_callback($pattern_1, 'replace', $content);