https://www.mediawiki.org/wiki/Special:Code/MediaWiki/114663
Revision: 114663
Author: van-de-bugger
Date: 2012-04-02 20:59:47 +0000 (Mon, 02 Apr 2012)
Log Message:
-----------
Bug fixed: Sometimes array is not rmpty, but there is no element with zero
index. This causes an exception. array_shift is used to avoid such a problem.
Modified Paths:
--------------
trunk/extensions/SemanticTitle/SemanticTitle.class.php
Modified: trunk/extensions/SemanticTitle/SemanticTitle.class.php
===================================================================
--- trunk/extensions/SemanticTitle/SemanticTitle.class.php 2012-04-02
20:51:07 UTC (rev 114662)
+++ trunk/extensions/SemanticTitle/SemanticTitle.class.php 2012-04-02
20:59:47 UTC (rev 114663)
@@ -47,7 +47,7 @@
$property = SMWDIProperty::newFromUserLabel( $label );
$values = $data->getPropertyValues( $property );
if ( count( $values ) > 0 ) {
- $value = $values[ 0 ];
+ $value = array_shift( $values );
if ( $value->getDIType() ==
SMWDataItem::TYPE_STRING ) {
$name = $value->getString();
if ( $name != '' ) {
_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs