[关闭]
@luoshilu 2018-08-30T09:29:24.000000Z 字数 666 阅读 515

图片后缀分析

临时文件


JS:

  1. 图片添加/转化后缀

xxx.com/xxx => xxx.com/xxx!postcover
xxx.con/xxx!poststd => xxx.con/xxx!postcover

2.通过src来获取图片URL

photoStr = imgArr[0].match(/[\']?http([^\'\"]*)!poststd[\']?/gi); (admin\app\questiondetail.js,(admin,pc)\public\main.js)

CSS/less
1. common-party.less 使用了!postcover后缀
2. reset.less 使用了!postthumb后缀

PHP 模板
1.后缀的替换

str_replace('!postcover','',$img);?>!postcover

2.后缀的添加

$posts['img_cover']; ?>!postcover

3.默认图片

http://qyimg.b0.upaiyun.com/inpost/20160520/szj0tb8h9jlufovvqjb7p2ntth2ngosj.jpg
http://qyimg.b0.upaiyun.com/inpost/20160520/szj0tb8h9jlufovvqjb7p2ntth2ngosj.jpg!postcover

php 控制器
1. 添加后缀
2. 识别图片URL

$pattern = "/<[img|IMG].?src=\'|\"[\'|\"].?[\/]?>/";(controllers\post.php)

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注