暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

遭遇Magpie多年前的一个Bug

原创 eygle 2007-07-28
920

昨天有朋友在MSN上告诉我,我的Erss不能访问了,我看了一下果然是出了问题,错误提示是:

Fatal error: Only variables can be passed by reference
in .../inc/magpie/rss_parse.inc on line 352


我的RSS订阅用的是DCBA增强过的Lilina,而Lilina的后台用的是Magpie,这个问题显然出在Magpie上。


Google一下,赫然发现居然遭遇了几年前Magpie的一个Bug,解决方案早已给出,extlib/rss_parse.inc需要修正,diff文件在以下地址可以找到:
http://svn.gregarius.net/trac/attachment/ticket/175/namespace.diff


主要的变更为:


extlib/rss_parse.inc

















































































































































oldnew 
350350        if ( $this->current_namespace )
351351        { 
352352            if ( $this->initem ) { 
 353                $real_element = ""; 
 354 
 355                $element_tree = explode("_", $el); 
 356                $real_element =& $this->current_item[ $this->current_namespace ]; 
 357 
 358                foreach ($element_tree as $tree_element) { 
 359                    if (!is_array($real_element)) { 
 360                        $real_element = array(); 
 361                    } 
 362 
 363                    $real_element =& $real_element[$tree_element]; 
 364                } 
 365 
353366                $this->concat( 
354                     $this->current_item[ $this->current_namespace ][ $el ], $text); 
 367                    $real_element, $text); 
355368            } 
356369            elseif ($this->inchannel) { 
357370                $this->concat( 
...... 
367380            } 
368381        } 
369382        else { 
370             if ( $this->initem ) { 
 383            if ( $this->initem && !is_array($this->current_item[ $el ])) { 
371384                $this->concat( 
372385                    $this->current_item[ $el ], $text); 
373386            } 


不过有一点不解的是,这个Bug是怎么触发的?为什么今天被我遇到了?
记录一下,也许还有别人会遇到的。


-The End-

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论