Skip to content

Commit

Permalink
XML import plugin does not process links
Browse files Browse the repository at this point in the history
There was an error in the if statement logic in ImportXML::import(), due
to an incorrectly placed closing parenthesis, the replace statement was
never executed.

Fixes #17774
  • Loading branch information
dregad committed Nov 7, 2014
1 parent 7d3dd43 commit aea1a34
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions plugins/XmlImportExport/ImportXml.php
Original file line number Diff line number Diff line change
Expand Up @@ -176,15 +176,15 @@ public function import() {
$t_bug_link_regexp = '/(^|[^\w])(' . preg_quote( $this->source_->issuelink, '/' ) . ')(\d+)\b/e';
# replace links in description
preg_match_all( $t_bug_link_regexp, $t_bug->description, $t_matches );
if( is_array( $t_matches[3] && count( $t_matches[3] ) > 0 ) ) {
if( is_array( $t_matches[3] ) && count( $t_matches[3] ) > 0 ) {
$t_content_replaced = true;
foreach ( $t_matches[3] as $t_old_id2 ) {
$t_bug->description = str_replace( $this->source_->issuelink . $t_old_id2, $this->getReplacementString( $this->source_->issuelink, $t_old_id2 ), $t_bug->description );
}
}
# replace links in additional information
preg_match_all( $t_bug_link_regexp, $t_bug->additional_information, $t_matches );
if( is_array( $t_matches[3] && count( $t_matches[3] ) > 0 ) ) {
if( is_array( $t_matches[3] ) && count( $t_matches[3] ) > 0 ) {
$t_content_replaced = true;
foreach ( $t_matches[3] as $t_old_id3 ) {
$t_bug->additional_information = str_replace( $this->source_->issuelink . $t_old_id3, $this->getReplacementString( $this->source_->issuelink, $t_old_id3 ), $t_bug->additional_information );
Expand Down

0 comments on commit aea1a34

Please sign in to comment.