Errors in share.tpl preventing "Share this page" from working?
Greetings!
I think I have found a bug in the file ../templates/mail/share.tpl. But I have so little knowledge of the tech involved in Tikiwiki that I'm not certain, so I thought I'd pass it on and either learn something or help someone.
First, my installation is Tikiwiki 6.2, installed on a Windows 2003 Server under XAMPP (Apache Friends v1.7.3). Install is pretty much stock.
Tikiwiki's email settings are to use STMP to my internal mail server, port 25, no authentication. This server is an old Linux Redhat box running Qmail.
I was having problems with email functions:
- sending an email from the test box in General -> General Settings -> Mail section works
- sending an email for registration of new users doesn't work
- sending a "Share this page" email doesn't work.
By examining the logs of my mail server, I could see it was complaining about "Bare line feeds" when I was sending the "Share this page" email. Qmail SMTP is picky about this and won't accept emails with a bare line feed.
After some browsing around I found ../templates/mail/share.tpl, and examining it shows what might be the problem:
{if !empty($comment)} {$comment} {else} {tr}Look at this link:{/tr} {/if} {$url_for_friend|replace:' ':'+'} {$name|username} {$email}
The blank line (#7) is really a linefeed (0x0a), and this is what Qmail is objecting about. So I added a hyphen to this line:
{if !empty($comment)} {$comment} {else} {tr}Look at this link:{/tr} {/if} {$url_for_friend|replace:' ':'+'} - {$name|username} {$email}
and now I can use the "Share this page" feature.
Now, I wonder if there are similar problems in other templates that are causing my other problems?
Note that this might be limited to people using Qmail; as I said, it's pretty picky about this issue. Changing the setting for CR LF vs. LF in the General settings page doesn't fix this.
Hope this helps someone.