Forums | Mahara Community

Support /
RSS feeds


anonymous profile picture
Account deleted
Posts: 1643

11 February 2009, 17:27

Hi Daniel - can you provide a link to a feed that works and a feed that doesn't? I could have a look at the code and establish exactly why the non-working one is failing.
anonymous profile picture
Account deleted
Posts: 6

15 February 2009, 8:53

thanks nigel, we're seem to have a fix, although not fully utf-8 friendly, acuted chars showing as questionmarks

 http://hu.php.net/manual/en/function.unserialize.php#84730
that's the prob
in blocktype/externalfeed/lib.php there's this part where the red marked is crucial

      public static function render_instance(BlockInstance $instance) {                                                                                       
        $configdata = $instance->get('configdata');                                                                                                         
        if ($configdata['feedid']) {                                                                                                                        
            $data = get_record('blocktype_externalfeed_data', 'id', $configdata['feedid']);                                                                 
                                                                                                                                                            
$data->content = preg_replace('!s:(\d+):"(.*?)";!se', '"s:".strlen("$2").":\"$2\";"', $data->content );                                                     
                                                                                                                                                            
            $data->content = unserialize($data->content);  

 

 are you fine with this, any ideas?

best,

Daniel

anonymous profile picture
Account deleted
Posts: 1643

15 February 2009, 16:23

Hi,

I'm not happy applying that solution until I know exactly why it's necessary. It looks like it could be slow and potentially insecure (use of 'e' modifier in preg_replace), so I'd want to be sure it was the correct solution to the problem first. Testing on the command line shows that there's no reason for serialize to be broken for UTF8:

nigel@sivlex:~$ php -r '$str = "Ə"; print_r(unserialize(serialize($str)));' 2>/dev/null; echo
Ə

 In order to find out what the exact problem is, can you please give me the following information:

  • What type and version of database are you using?
  • What is the URL to the RSS feed that breaks?
  • Do you have magic_quotes_gpc or magic_quotes_runtime on?
  • Any other info that will help me duplicate this bug on my system?
anonymous profile picture
Account deleted
Posts: 1

16 February 2009, 9:05

Hello Nigel,

I`m a friend of Daniel.

  • We are using a MySQL server version 5.0.32-Debian_7etch5.
  • All magic_quotes_* are off.

There are two URL where you can see the diff.

Here is the original (untouched) version: http://mahara.smartinfo.hu/view/view.php?id=19

and here is the modified version: http://mahara2.smartinfo.hu/view/view.php?id=19

These are two independent instance of Mahara version 1.0.9 (2008040218).

If I could help you more information, please ask me.

Best regards

Gabor Molnar 

 

anonymous profile picture
Account deleted
Posts: 1643

16 February 2009, 16:36

Thanks for this information, it should be enough for me to duplicate the problem.
anonymous profile picture
Account deleted
Posts: 6

24 February 2009, 4:43

can we help the process anyhow?

 Daniel

anonymous profile picture
Account deleted
Posts: 1643

24 February 2009, 17:28

Hi - sorry, I've been very busy with the Mahara 1.1 release, so haven't had a chance to look at this in detail. I've filed a bug for it so I don't forget it.

You can help by filling out more info on the bug report, if you have any. If you're convinced that <entry> is skipped, then preparing a patch for that would be very helpful Smile

17 results