Possible bug in blocks

Possible bug in blocks

Tim Hunt發表於
Number of replies: 3
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
But I don't understand blocks.

I getting errors from about like 885 of blocklib.php which says

        $blocknames = explode(',', $posblocks[$i]);

I think this does the wrong thing if $posblocks[$i] is '' (for example if you have no blocks in either the left or right column). Instead I think it should be

        $blocknames = $posblocks[$i] ? explode(',', $posblocks[$i]) : array();      

Can someone who understands these things either confirm or deny. Thanks.
評比平均分數: -
In reply to Tim Hunt

Re: Possible bug in blocks

Martin Dougiamas發表於
Core developers的相片 Documentation writers的相片 Moodle HQ的相片 Particularly helpful Moodlers的相片 Plugin developers的相片 Testers的相片
array() makes more sense to me than FALSE.
In reply to Martin Dougiamas

Re: Possible bug in blocks

Tim Hunt發表於
Core developers的相片 Documentation writers的相片 Particularly helpful Moodlers的相片 Peer reviewers的相片 Plugin developers的相片
This issue is the stupid feature of explode, where if you explode an empty string, you get array(''), instead of array(), which is always what you want, so you always need an if statement.