Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
PUBLIC CLOUD
PRIVATE CLOUD
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Web CMS (TeamSite)
issue with Image path processing in 6.5
motlnt
Hi All,
I am facing this strange issue with image path processing.
My env:
TS 6.5 (Upgra)
Win2003 (Ent. edition)
I have following lines coded in my IPL ,
# make all non-absolute image paths /images/.
$filedata =~ s/(<[^>]*IMG.*?src\=[\"|\'])([^\/|http][^>]*)/$1\/$2/g;
# make all iw-mount image paths -> /images/
$filedata =~ s/(<[^>]*IMG.*?src\=[\"|\'])\/iw-mount.*?(\/images.*?>)/$1$2/ig;
Example:
<img src="images/blah.gif">
<img src="/iw-mount/blah/lbhal/xx.gif" >
becomes:
<img src="/images/blah.gif">
<img src="/images/xx.gif" >
surprisingly this works fine in 5.5.2 and not in 6.5
any comments?
thx in advance,
JM
Find more posts tagged with
Comments
JonathonG
I don't see anything wrong with the second regex. The first one, however, is missing the 'i' modifier, and could be written more simply as:
# make all non-absolute image paths /images/.
$filedata =~ s/(<IMG.*?src\=[\"\'])(images.*?>)/$1\/$2/ig;
Jonathon
Interwoven Developer
Allstate, Inc.
motlnt
Still doesnt work,
all of the image paths are having iw-mount inside ....
so the 2nd regex is usually called..
JM
jbonifaci
Did your change your store/branch structure at all during the upgrade?
Can you post the exact contents of $filedata before and after the regex's are run?
motlnt
here are the 2 files taken from log.....
before & after
JM
jbonifaci
You did not attach anything...
motlnt
oops..
i can not attach 2 files to a post on devnet..
JM
motlnt
after...
JM
jbonifaci
FYI, when attaching multiple files, zip them...
jbonifaci
Looking at your log file, you'll see your regex is working if the img tag is all on one line. The problem you are having is . does not match new lines. Change your pattern match modifiers to be
s
ig
and your regex will work as you want.
~Jeff
motlnt
it worked...
you rock man!!!!
JM