Menu

#1011 PHP "Copy as RTF"

Bug
closed-fixed
SciTE (658)
2
2013-07-21
2010-08-14
rmccullough
No

When trying to "Copy as RTF" some PHP code, the syntax highlighting does not come through correctly.

Paste this code into Sc1:
<?
$fields = array(
'version'=>urlencode('2009-11-20'),
'SignatureVersion'=>urlencode('1'),
'Action'=>urlencode('UserUpdate'),
'UserEmail'=>urlencode('me@mail.com'),
'payload'=>urlencode('<?xml version="1.0" encoding="UTF-8"?><user><profile><field id=\"6\"><value>MemberId</value></field></profile></user>'),
);

$fields_string = '';
foreach($fields as $key=>$value)
{
$fields_string .= $key.'='.$value.'&';
}
rtrim($fields_string,'&');

$options = array (
CURLOPT_URL => 'http://site.com/api/endpoint',
CURLOPT_USERPWD => 'user:password',
CURLOPT_RETURNTRANSFER => true, // return web page
CURLOPT_USERAGENT => 'User Agent', // who am i
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $fields_string,
);
$ch = curl_init();
curl_setopt_array($ch, $options);
$content = curl_exec($ch);
$headers = curl_getinfo($ch);
print("UserGet Content: " . print_r($content, true) . "\n");
?>

Now, select all and "Copy as RTF". Paste into MS Word (or similar). Notice how the opening and closing PHP code is highlighted in yellow, all of the text has the font copied correctly, but there is no syntax highlighting. All code is black. I have attached an example. Other language types do not have this problem.

Discussion

  • rmccullough

    rmccullough - 2010-08-14

    Pasted RTF code

     
  • Neil Hodgson

    Neil Hodgson - 2010-08-14

    Since I don't use this feature, I will not be fixing it myself.

     
  • Neil Hodgson

    Neil Hodgson - 2010-08-14
    • assigned_to: nobody --> nyamatongwe
    • priority: 5 --> 2
    • status: open --> open-accepted
     
  • Nobody/Anonymous

    4HTh6k <a href="http://hrlojhatyvsr.com/">hrlojhatyvsr</a>, [url=http://dgguuwjzxxhb.com/]dgguuwjzxxhb[/url], [link=http://qkgcrssjvofq.com/]qkgcrssjvofq[/link], http://fopmoeziannm.com/

     
  • Neil Hodgson

    Neil Hodgson - 2013-06-12
    • status: open-accepted --> open-fixed
     
  • Neil Hodgson

    Neil Hodgson - 2013-06-12

    Fix committed as [f3900b].

     

    Related

    Commit: [f3900b]

  • Neil Hodgson

    Neil Hodgson - 2013-07-21
    • status: open-fixed --> closed-fixed
     

Log in to post a comment.