djplaner / moodle-mod_bim

A Moodle activity module the provides support for managing/marking individual student blogs hosted on external services.
http://davidtjones.wordpress.com/research/bam-blog-aggregation-management/
7 stars 2 forks source link

Issues with UTF8 characters #22

Closed tlock closed 14 years ago

tlock commented 14 years ago

This byte string was making the adodb logger to fail and bim marking to fail on find student :-

'A' (65) 's' (115) 's' (115) 'i' (105) 'g' (103) 'n' (110) 'm' (109) 'e' (101) 'n' (110) 't' (116) 's' (115) '�' (226) '�' (128) '�' (153)

function bim_clean_content( $content ) {

djplaner commented 14 years ago

Sorry Tim. I'm struggling to understand this one.

As far as I know, bim_clean_content only gets called when processing the RSS, which is before bim marking. And, I'm not sure what the fix is.

Sorry for being thick.

tlock commented 14 years ago

The fix is to replace chr(153) ($badchr) with nothing you have done with other characters like chr(226) and chr(128). Looking back at this I think I need to add an entry for coresponding $goodchr array to replace array key 16 (17th) with ''

tlock commented 14 years ago

diff --git a/mod/bim/lib/bim_rss.php b/mod/bim/lib/bim_rss.php index 078de9c..16113fb 100644 --- a/mod/bim/lib/bim_rss.php +++ b/mod/bim/lib/bim_rss.php @@ -424,7 +424,7 @@ function bim_clean_content( $content ) { $goodchr = array( '"', '"', "'", "'", "...", "-", "-", '\'', '-',

djplaner commented 14 years ago

Thanks Tim. Adding this now.