From: <jfi...@us...> - 2003-03-20 07:27:12
|
Update of /cvsroot/mantisbt/mantisbt/core In directory sc8-pr-cvs1:/tmp/cvs-serv23928/core Modified Files: print_api.php Log Message: * core/print_api.php (get_email_link): don't apply string_url() to the whole mailto link since it causes @ to be escaped which doesn't work well when you copy the email address from the browser's context menu and paste it somewhere else (get_email_link_with_subject): ditto Index: print_api.php =================================================================== RCS file: /cvsroot/mantisbt/mantisbt/core/print_api.php,v retrieving revision 1.62 retrieving revision 1.63 diff -u -d -r1.62 -r1.63 --- print_api.php 12 Mar 2003 18:27:13 -0000 1.62 +++ print_api.php 20 Mar 2003 07:27:09 -0000 1.63 @@ -980,10 +980,13 @@ return $p_text; } - $p_email = string_url( $p_email ); + # If we apply string_url() to the whole mailto: link then the @ + # gets turned into a %40 and you can't right click in browsers to + # do Copy Email Address. + $t_mailto = string_attribute( "mailto:$p_email" ); $p_text = string_display( $p_text ); - return "<a href=\"mailto:$p_email\">$p_text</a>"; + return "<a href=\"$t_mailto\">$p_text</a>"; } # -------------------- # print a mailto: href link with subject @@ -999,11 +1002,15 @@ return $p_text; } - $p_email = string_url( $p_email ); - $p_text = string_display( $p_text ); + # If we apply string_url() to the whole mailto: link then the @ + # gets turned into a %40 and you can't right click in browsers to + # do Copy Email Address. If we don't apply string_url() to the + # summary text then an ampersand (for example) will truncate the text $p_summary = string_url( $p_summary ); + $t_mailto = string_attribute( "mailto:$p_email?subject=$p_summary" ); + $p_text = string_display( $p_text ); - return "<a href=\"mailto:$p_email?subject=$p_summary\">$p_text</a>"; + return "<a href=\"$t_mailto\">$p_text</a>"; } # -------------------- # Print a hidden input for each name=>value pair in the array |