Up to [Local Repository] / interchange / code / UserTag
Request diff between arbitrary revisions
Keyword substitution: kv
Default branch: MAIN
Fix incorrect license in headers GPL v2 -> GPL v2 "or later". Update copyrights.
Fix incorrect license in headers GPL v2 -> GPL v2 "or later". Update copyrights.
Extended Net::SMTP support. Before it was not possible to send email with attachments while using Net::SMTP as the mail agent. From now on the email tag does not rely on the email_raw tag anymore.
Big copyright and version number update to prepare for 5.3.2 release.
* Prevent double-setting of From: header.
fix garbled subject if reply is set, the newline is important
Move check for MIME::Lite to earliest sensible place.
Prevent spammer abuse of [email] tag via header injection in inputs such as To, From, Subject. Properly handle multiple-line "folded" headers as per RFC, but reject any other newlines attempted injection abuses. Properly tolerate missing MIME::Lite module, as appears to have been originally intended. Bring back cosmetic changes from version 1.6, which were nuked in 1.7.
* Enhance [email ...] tag to handle attachments. Requires MIME::Lite module,
which I have added to Bundle::Interchange[KitchenSink].
* To do the common request of HTML messages, you simply add an html parameter
thusly:
[email
from=foo@bar.com
to=bar@foo.com
subject=test
html="[scratch some_big_hairy_mess]"
]This is the plain text part.[/email]
This sets the main message type as multipart/alternative, automatically
sets the content-type and disposition of the two parts, and creates a
valid text-and-HTML message.
* To add a single file as an attachment, you just do:
[email
from=foo@bar.com
to=bar@foo.com
subject=test
attach=foo.gif
] Here is the gif file I promised. [/email]
It automatically picks up the MIME type, and handles many if you
have the optional MIME::Types module installed.
* To add multiple files, or for more control over the attachments,
the attach option accepts hashes.
[email
from=foo@bar.com
to=bar@foo.com
subject=test
attach.0=`{
type => 'image/gif',
path => 'images/foo.gif',
}`
attach.1=`{
type => 'image/jpeg',
path => 'images/foo.jpg',
}`
] Here are the files I promised. [/email]
This would be the same as:
[email
from=foo@bar.com
to=bar@foo.com
subject=test
attach=`[
{
type => 'image/gif',
path => 'images/foo.gif',
filename => 'PrettyName.gif',
},
{
type => 'image/jpeg',
data => $Tag->file('tmp/foo.jpeg')
|| $Tag->file('images/broken.jpg'),
filename => 'PrettyName.jpg',
},
]`
] Here are the files I promised. [/email]
Clean up formatting a bit and remove unused named code block.
Header/license fix or Version update+minor formatting fix, or both
* header/license fix * documented in xmldocs
updated LINUXIA branch to 4.9 sources in order to use it as testbed again
* Merge change from stable (remove archaic split use, add error check)
* Add enhancement made by Jurgen Botz to use send_mail program so that Net::SMTP can send the email tag. Thanks Jurgen!
* The great tag breakout!
* Almost all tags are now UserTag definitions. The only exceptions
are:
and bounce goto if label or unless
* New TagDir directive (default is VENDROOT/code) sets the
directory (or directories) which are searched for code definitions
set by UserTag and CodeDef.
* New TagGroup directive establishes groups of ITL tags which can
be included.
TagGroup :crufty "banner default ecml html_table onfly sql"
The default groups include :core, which contains all of the
ITL tags defined in 4.8/early 4.9. The groups are defined
in $Vend::Cfg::StdTags and can be undefined if desired
with "TagGroup :group".
* New TagInclude directive allows inclusion of tags (or groups
of tags). If a tag is defined as a core tag (with a .coretag
or .tag or .ct extension) and is not included, it will not
be compiled and placed in the tag map. This is for all catalogs,
so if *any* catalog uses a tag it must be included.
Examples:
# Include the base tags
TagInclude :core
# Not the commerce tags
TagInclude !:commerce
# But make sure item-list is included even though
# it is in :commerce
TagInclude item-list
## Double negatives are honored
TagGroup :foo "bar !baz buz"
## With the group above, the below is equivalent
## to TagInclude !bar baz !buz
TagInclude !:foo
* New CodeDef directive allows the setting of filters,
order checks, FormAction, ActionMap, ItemAction,
and LocaleChange.
## filters
CodeDef mixedcase Filter
CodeDef mixedcase Routine <<EOR
sub {
my $val = shift;
## [filter mixedcase]mixed case[/filter]
## outputs "MiXeD CaSe"
$val =~ s/(.)(.)/\u$1\l$2/g;
return $val;
}
EOR
## order checks
CodeDef mixedcase OrderCheck
CodeDef foo Routine <<EOR
sub {
my ($ref, $var, $val) = @_;
return (1,$var) if $val eq 'bar';
return (0,$var, "foo must be bar");
}
EOR
All work in catalog.cfg; LocaleChange and ItemAction are not
global. FormAction, ActionMap, and ItemAction directives
are equivalent to their CodeDef equivalents.