disallow 8 bit characters and control characters in HTML view

View: New views
2 Messages — Rating Filter:   Alert me  

disallow 8 bit characters and control characters in HTML view

by Roberto S. G. :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,
Actual SM versions disallow links (clicking in "show html") which
contain what in English ascii may seem "control" characters... actually
there are (closed) applications which use regional chars in their long
url links (with vars and so...) and SM blocks them.
So in my case I had to slightly modify next code in functions/mime.php
in order to let SM show them, broading the range of allowed chars:

         // first, disallow 8 bit characters and control characters
-        if (preg_match('/[\0-\37\200-\377]+/',$attvalue)) {
+        if (preg_match('/[\0-\37\200-\277]+/',$attvalue)) {

Don't know how to make it better... A global SM admin option to allow
regional chars in urls would be feasible?

bye

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel

Re: disallow 8 bit characters and control characters in HTML view

by Paul Lesniewski :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Fri, Dec 5, 2008 at 9:32 AM, Roberto S. G. <roberto.santos@...> wrote:

> Hi,
> Actual SM versions disallow links (clicking in "show html") which
> contain what in English ascii may seem "control" characters... actually
> there are (closed) applications which use regional chars in their long
> url links (with vars and so...) and SM blocks them.
> So in my case I had to slightly modify next code in functions/mime.php
> in order to let SM show them, broading the range of allowed chars:
>
>         // first, disallow 8 bit characters and control characters
> -        if (preg_match('/[\0-\37\200-\377]+/',$attvalue)) {
> +        if (preg_match('/[\0-\37\200-\277]+/',$attvalue)) {
>
> Don't know how to make it better... A global SM admin option to allow
> regional chars in urls would be feasible?

I think the best chance of getting something like this into SM would
be to have a patch (against 1.5.2) that looks for a global variable
such as $allow_8_bit_chars_in_link_urls and if found and if true, does
what you want.  That variable does not need to be added anywhere else
to the SM code - just a note that admins that need that functionality
should add it to config/config_local.php.  On the other hand, those
chars are disallowed for good reason...  making this change may open
up your users to exploits hidden in emails that are not generated
locally.

------------------------------------------------------------------------------
SF.Net email is Sponsored by MIX09, March 18-20, 2009 in Las Vegas, Nevada.
The future of the web can't happen without you.  Join us at MIX09 to help
pave the way to the Next Web now. Learn more and register at
http://ad.doubleclick.net/clk;208669438;13503038;i?http://2009.visitmix.com/
-----
squirrelmail-devel mailing list
Posting guidelines: http://squirrelmail.org/postingguidelines
List address: squirrelmail-devel@...
List archives: http://news.gmane.org/gmane.mail.squirrelmail.devel
List info (subscribe/unsubscribe/change options): https://lists.sourceforge.net/lists/listinfo/squirrelmail-devel