r86425 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86424‎ | r86425 | r86426 >
Date:19:41, 19 April 2011
Author:mkroetzsch
Status:deferred
Tags:
Comment:
fixed wrong array index
Modified paths:
  • /trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlResultParser.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SemanticMediaWiki/includes/sparql/SMW_SparqlResultParser.php
@@ -87,7 +87,7 @@
8888 } elseif ( ( $tagName == 'result' ) && ( $prevTag == 'results' ) ) {
8989 $row = array();
9090 for ( $i = 0; $i < count( $this->m_header ); ++$i ) {
91 - $row[] = null;
 91+ $row[$i] = null;
9292 }
9393 $this->m_data[] = $row;
9494 } elseif ( ( $tagName == 'literal' ) && ( $prevTag == 'binding' ) ) {
@@ -120,11 +120,11 @@
121121 $prevTag = end( $this->m_xml_opentags );
122122 $rowcount = count( $this->m_data );
123123 if ( $prevTag == 'uri' ) {
124 - $this->m_data[$rowcount][$this->m_xml_bindidx] = new SMWExpResource( $dataString );
 124+ $this->m_data[$rowcount-1][$this->m_xml_bindidx] = new SMWExpResource( $dataString );
125125 } elseif ( $prevTag == 'literal' ) {
126 - $this->m_data[$rowcount][$this->m_xml_bindidx] = new SMWExpLiteral( $dataString, $this->m_xml_datatype );
 126+ $this->m_data[$rowcount-1][$this->m_xml_bindidx] = new SMWExpLiteral( $dataString, $this->m_xml_datatype );
127127 } elseif ( $prevTag == 'bnode' ) {
128 - $this->m_data[$rowcount][$this->m_xml_bindidx] = new SMWExpResource( '_' . $dataString );
 128+ $this->m_data[$rowcount-1][$this->m_xml_bindidx] = new SMWExpResource( '_' . $dataString );
129129 } elseif ( $prevTag == 'boolean' ) { // no "results" in this case
130130 $literal = new SMWExpLiteral( $dataString, 'http://www.w3.org/2001/XMLSchema#boolean' );
131131 $this->m_data = array( array( $literal ) );

Status & tagging log