RSS

关于live spaces转帖到discuz 图片失败的不完美解决

05 Mar

 

live space上好好的blog直接转到discuz成了

因为live spaces上的图片转文的时候会自动将image20.jpg修改为image[20].jpg,导致discuz无法识别出图片地址,进而大量的图片地址直接显露给end-user。

而实际上

https://t5jyjw.blu.livefilestore.com/y1mXsLjVa1oaTAlq9UHbk9yy_dc2rRqd9Ib8m-8f1l7thOA4TiYDF0jo_70ADsceqGQBS8bQJx6w4WPd-zn5v7g1CAwV5g8v5TbBtd2y9VMI9cvRpkCVXRWb_xSSl28cW8CX7Np7vEmk7c/image[48].png

https://t5jyjw.blu.livefilestore.com/y1mXsLjVa1oaTAlq9UHbk9yy_dc2rRqd9Ib8m-8f1l7thOA4TiYDF0jo_70ADsceqGQBS8bQJx6w4WPd-zn5v7g1CAwV5g8v5TbBtd2y9VMI9cvRpkCVXRWb_xSSl28cW8CX7Np7vEmk7c/image48.png

都是可以拿到图片的,同理http和https地址也是相同的。

找了个办法:

在code arichitects regex tester中用正则匹配并替换

(?<=image|thumb)\[(?’x’\d+)\](?=\%|.png)

能解决大部分问题,但是细微的地方还待手动。

Advertisements
 
Leave a comment

Posted by on March 5, 2009 in Windows Live

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

 
%d bloggers like this: