By Paul Bradley on Thursday, 22 September 2016
Posted in Technical Issues
Replies 3
Likes 0
Views 325
Votes 0
Hi,

After upgrading to EB 5.0.37, we started seeing PHP Notices in our development system (and in the server logs on live) for

PHP Notice: Undefined offset: 1 in /var/www/html/administrator/components/com_easyblog/includes/post/post.php on line 3658

Further investigation reveals this is almost certainly down to a too specific test on line 3657 which currently reads as:
if ($pos !== false) {
But should be changed to:
if ($pos != false) {
Since $pos is set by preg_match which returns, 0, 1, or FALSE. The conditional code should only execute if it's 1 (so the test could be ($post == 1) but != false somehow feels better - I can't explain why!)

Hope this helps
Hi Paul Bradley,

I've logged this issue in our issue tracker and our developers will take an action for this.

Thanks for understanding
·
Friday, 23 September 2016 11:20
·
0 Likes
·
0 Votes
·
0 Comments
·
Thanks for that. I'm afraid there's another minor issue on line 1049. Currently, it reads:

if ($trackHits[0] == 'Disqus') {

But trackHits is set by preg_match - if there is no match, then trackHits is empty, so the test should be something like:

if ( !empty($trackHits) && ($trackHits[0] == 'Disqus') ) {

Thanks
·
Monday, 26 September 2016 17:33
·
0 Likes
·
0 Votes
·
0 Comments
·
Hello Paul,

Thanks for the input on both these issues and they are both definitely nasty bugs. I have applied these fixes internally and it should work fine on the next release
·
Tuesday, 27 September 2016 00:38
·
0 Likes
·
0 Votes
·
0 Comments
·
View Full Post