python - Broken images in calendar feed in Plone CMS -


We have broken images from time to time in the calendar feed on the main home page. The problem is that our script that pulls the feed into the Home Scheme is prepaid on all image URLs, which creates a failure when the image in question is hosted on the remote server instead of the network server. How can I tweak the script so that it does not add to a root URL url if an image url already has HTTP?

Here is the snippet of the Python script which I need to modify:

   and  & lt; / Div & gt;   

If "URL" is already linked to "remote" (remote server), how can I add an "if" statement to leave the part? Thanks for your help!

As a stopgap, it can work (untested - I do not have an installation at home ):

  & lt; Img tal: define = "url python: event ['image'] and event ['image'] ['URL'];" Tal: condition = "python: event ['image']" tal: attributes = "src python: url url.startswith ('http') and 'http: //events.foo.edu%s'% (url,) ; Alt Python: Incident ['Title']; Width String: 40px "/> gt; & Lt; / A & gt;   

(Note that your code does not handle the event ['image'] is not an entry URL , nor my There may be a more elegant solution for using

, Path, query, piece, and you can re-collect it from there.

In detail, we define a variable url on a small part of typing - we have to first see it again event ['image'] < / Code> exists. The entire tag is protected by tal: condition , but this execution order always repeats defined , condition , , content / replaced , attributes , do not leave ; Here you can define a variable and use it in the condition section. We can give it the name of the url , but I usually do not name my variable in the all caps. The value of x is generated in the x and y yield in the dragon, and if it is true, then it is the value of y in the case of always , We will get the url-ish string from your object.

The new features section may be confusing because it is underparted: //events.foo.edu%s'% (url,));

So this is the normal string formatting, given that % s is finally, we might say that 'http: //events.foo .edu '+ url , but do not combine "constants" and user data simultaneously "triggers me" This is a potential command injection vulnerability "reflection.

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -