Dependency Graph View Issue Relation Graph Vertical
related to child of duplicate of

View Issue Details

IDProjectCategoryView StatusLast Update
0005476phpList 3 applicationGeneralpublic23-05-12 04:53
Status resolvedResolutionduplicate 
Product Version 
Target VersionFixed in Version 
Summary0005476: USE_MANUAL_TEXT_PART and content from [URL:<url>]
DescriptionWhen using the USE_MANUAL_TEXT_PART option, urls do not get replaced into the content.
Additional Informationhere is a patch to sendemaillib.php. It's not great, but it works. I am still getting familiar with how phplist works internally. It is really just reusing a block which did the html portion, but comments out one line. I'm sure this could just get better integrated and use a while loop for the html and text portions, but there are also a bunch of conditional blocks that I wasn't sure about. I have made a few other changes in this file so the line numbers probably won't match up.

TagsNo tags attached.


15-02-06 00:45


manual_text_part.patch (1,150 bytes)
*** ../../lists.orig/admin/sendemaillib.php     Mon Nov  7 06:41:05 2005
--- sendemaillib.php    Tue Feb 14 16:37:44 2006
*** 159,164 ****
--- 163,188 ----
+   $textcontent = $cached[$messageid]["textcontent"];
+   if ($GLOBALS["has_pear_http_request"] && preg_match("/\[URL:([^\s]+)\]/i",$textcontent,$regs)) {
+     while (strlen($regs[1])) {
+       $url = $regs[1];
+       if (!preg_match('/^http/i',$url)) {
+         $url = 'http://'.$url;
+       }
+       $remote_content = fetchUrl($url,$userdata);
+       if ($remote_content) {
+         $textcontent = eregi_replace(preg_quote($regs[0]),$remote_content,$textcontent);
+         // $cached[$messageid]["htmlformatted"] = strip_tags($textcontent) != $textcontent;
+       } else {
+         logEvent("Error fetching URL: $regs[1] to send to $email");
+         return 0;
+       }
+       preg_match("/\[URL:([^\s]+)\]/i",$textcontent,$regs);
+     }
+   }
+   $cached[$messageid]["textcontent"] = $textcontent;
    if ($cached[$messageid]["htmlformatted"]) {
      if (!$cached[$messageid]["textcontent"]) {
        $textcontent = stripHTML($content);
manual_text_part.patch (1,150 bytes)


15-02-06 00:48

reporter   ~0010689

sorry, forgot to mention again - 2.10.2.


18-02-06 18:09




28-04-06 04:51

manager   ~0013167

that's an interesting problem.

Basically, the "send a webpage" system, expects the content to be all HTML, as you are sending a webpage. So it fetches the content before converting to text. If you were to add the URL: bit to the text, you'd have to convert it to text afterwards.

Now the problem with your patch is "user parameters". You are caching the result in memory, but that will cause problems, when a URL is used like http://website/script.php?email=[email]

in this case the email is passed onto the URL and therefore the content may change. With your patch this would be applied to all subsequent users, which is not what we'd want.

Basically for now, I'd advice when using URL, send a webpage to only use the HTML version of the email and the resulting text email will be parsed out of that.

If I were to add support for the text version of an email to have "send a webpage", I would probably want to restrict the URL that is requested to be "text/plain", so that there is no need to parse it back into text from HTML.

I'm afraid I will mark this for the dev-version, and we'll see where it goes from there. I don't consider this a bugfix, so it won't get into 2.10.x