View Issue Details

IDProjectCategoryView StatusLast Update
0000865MyList ExportFeature Request - SDKpublic2008-07-28 16:07
Reporterpath Assigned Tofahrenheit  
PrioritynormalSeverityfeatureReproducibilityalways
Status resolvedResolutionfixed 
Summary0000865: addition of jsencodexml to the extra functions
Descriptionjsencodehtml is useful but some of the entities are not valid xml. So here's another one that is valid xml and can be still be understood by browsers.

sub jsencodexml
{
    my $str = shift;
    
    $str =~ s/\[i\]/\<i\>/g;
    $str =~ s/\[\/i\]/\<\/i\>/g;
    $str =~ s/\[b\]/\<b\>/g;
    $str =~ s/\[\/b\]/\<\/b\>/g;
    $str =~ s/\[u\]/\<u\>/g;
    $str =~ s/\[\/u\]/\<\/u\>/g;
    $str =~ s/\‘/\&#8217\;/g;
    $str =~ s/\'/\&0000039\;/g;
    $str =~ s/\"/\&0000034\;/g;
    $str =~ s/\`/\&#8216\;/g;
    $str =~ s/\r//g;
    $str =~ s/\n/\<br \/\>/g;

    return $str;
}
TagsNo tags attached.

Activities

2008-01-11 18:47

 

export_funcs.pm (877 bytes)

2008-01-11 18:47

 

export.pm (4,839 bytes)

path

2008-01-11 18:48

reporter   ~0001578

Ive attached the files themselves since pasting the contents didnt work too well

fahrenheit

2008-01-13 00:45

reporter   ~0001580

kay, it's on todo

fahrenheit

2008-02-18 16:09

reporter   ~0001699

should be up tonight, download export.pm and export_funcs.pm from the svn.

path

2008-07-23 07:08

reporter   ~0002212

there's still a small issue. For ' and " we have amp and 0000039 and 0000034. It should be 0000039 and 0000034. I think pasting it here screwed it up a bit.

path

2008-07-23 07:09

reporter   ~0002213

a small change. $str =~ s/\'/\&0000039\;/g;
    $str =~ s/\"/\&0000034\;/g;

it used to be
$str =~ s/\'/\&0000039\;/g;
    $str =~ s/\"/\&0000034\;/g;
 Need to insert the # character

path

2008-07-23 07:10

reporter   ~0002214

small change. Need to insert a hash (sharp) before 0000034 and 0000039 after the ampersand

path

2008-07-23 07:11

reporter   ~0002215

sorry about typing that thrice. I kept getting php errors so I thought the comment failed :/

fahrenheit

2008-07-28 16:07

reporter   ~0002235

fixed on the sdk files will be online whenever the next anidb update is done

Issue History

Date Modified Username Field Change
2008-01-11 18:45 path New Issue
2008-01-11 18:47 path File Added: export_funcs.pm
2008-01-11 18:47 path File Added: export.pm
2008-01-11 18:48 path Note Added: 0001578
2008-01-13 00:45 fahrenheit Note Added: 0001580
2008-01-13 00:45 fahrenheit Assigned To => fahrenheit
2008-01-13 00:45 fahrenheit Status new => acknowledged
2008-02-18 16:09 fahrenheit Status acknowledged => resolved
2008-02-18 16:09 fahrenheit Resolution open => fixed
2008-02-18 16:09 fahrenheit Note Added: 0001699
2008-07-23 07:08 path Status resolved => feedback
2008-07-23 07:08 path Resolution fixed => reopened
2008-07-23 07:08 path Note Added: 0002212
2008-07-23 07:09 path Note Added: 0002213
2008-07-23 07:10 path Note Added: 0002214
2008-07-23 07:11 path Note Added: 0002215
2008-07-28 16:07 fahrenheit Status feedback => resolved
2008-07-28 16:07 fahrenheit Resolution reopened => fixed
2008-07-28 16:07 fahrenheit Note Added: 0002235