root/trunk/cgi-bin/lj-bml-init.pl @ 994

Revision 994, 1.2 KB (checked in by bradfitz, 11 years ago)

<lj user=avva>:
This patch does two things:

1. Correctly encodes Subject: fields in emails as per RFC2047.
Note it uses MIME::Words , which should be on all our servers (I think
it's part of the standard distribution, but it's better to check).
2. Inserts a meta tag with encoding information in the beginning of
the HTML part of the email (some mail readers aren't smart enough to
apply the Content-type: information already there in the MIME header
to HTML attachments, so this gives them a clue).

Tested.

<lj user=bradfitz>:
the lj-bml-init/INSTALL changes

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1#!/usr/bin/perl
2#
3
4require 'ljconfig.pl';
5
6BML::register_block("DOMAIN", "S", $LJ::DOMAIN);
7BML::register_block("IMGPREFIX", "S", $LJ::IMGPREFIX);
8BML::register_block("SITEROOT", "S", $LJ::SITEROOT);
9BML::register_block("SITENAME", "S", $LJ::SITENAME);
10BML::register_block("ADMIN_EMAIL", "S", $LJ::ADMIN_EMAIL);
11BML::register_block("SUPPORT_EMAIL", "S", $LJ::SUPPORT_EMAIL);
12
13{
14    my $dl = "<a href=\"$LJ::SITEROOT/files/%%DATA%%\">HTTP</a>";
15    if ($LJ::FTPPREFIX) {
16        $dl .= " - <a href=\"$LJ::FTPPREFIX/%%DATA%%\">FTP</a>";
17    }
18    BML::register_block("DL", "DS", $dl);
19}
20
21BML::register_hook("startup", sub { LJ::start_request() });
22
23if ($LJ::UNICODE) {
24    BML::set_default_content_type("text/html; charset=utf-8");
25}
26
27# pre-load common libraries so we don't have to load them in BML files (slow)
28package BMLCodeBlock;
29use LJ::TextMessage;
30use LJ::TagGenerator ':html4';
31use Digest::MD5 qw(md5_hex);
32use MIME::Words qw(encode_mimewords);
33
34require 'imageconf.pl';
35require 'propparse.pl';
36require 'supportlib.pl';
37require 'ljlib.pl';
38require 'ljprotocol.pl';
39require 'cleanhtml.pl';
40require 'emailcheck.pl';
41require 'portal.pl';
42require 'talklib.pl';
43require 'topiclib.pl';
44require 'ljtodo.pl';
45require 'directorylib.pl';
46
47
481;
Note: See TracBrowser for help on using the browser.