From 5212228269bb7b8d1509db9b6b0e01397361d404 Mon Sep 17 00:00:00 2001 From: Youri vd Bogert Date: Thu, 25 Jan 2018 13:02:54 +0100 Subject: [PATCH 1/2] Bug fixes --- LinkAttributes.body.php | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/LinkAttributes.body.php b/LinkAttributes.body.php index da3ba36..53ab87c 100644 --- a/LinkAttributes.body.php +++ b/LinkAttributes.body.php @@ -23,14 +23,8 @@ private function doExtractAttributes ( &$text, &$attribs ) { $pair = explode( '=', $a ); /* Only go ahead if we have a aaa=bbb pattern, and aaa i an allowed attribute */ - if ( isset( $pair[1] ) && in_array( $pair[0], self::attrsAllowed ) ) { - - /* Add to existing attribute, or create a new */ - if ( isset( $attribs[$pair[0]] ) ) { - $attribs[$pair[0]] = $attribs[$pair[0]] . ' ' . $pair[1]; - } else { - $attribs[$pair[0]] = $pair[1]; - } + if ( isset( $pair[1] ) && in_array( $pair[0], self::$attrsAllowed ) ) { + $attribs[$pair[0]] = (isset($attribs[$pair[0]])) ? $attribs[$pair[0]] . ' ' . $pair[1] : $attribs[$pair[0]]; } } From aa39cfd4a2cae17c76bd98ede53ce97b81104eea Mon Sep 17 00:00:00 2001 From: Youri vd Bogert Date: Thu, 25 Jan 2018 13:05:12 +0100 Subject: [PATCH 2/2] Update LinkAttributes.body.php --- LinkAttributes.body.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LinkAttributes.body.php b/LinkAttributes.body.php index 53ab87c..fcc3870 100644 --- a/LinkAttributes.body.php +++ b/LinkAttributes.body.php @@ -24,7 +24,7 @@ private function doExtractAttributes ( &$text, &$attribs ) { /* Only go ahead if we have a aaa=bbb pattern, and aaa i an allowed attribute */ if ( isset( $pair[1] ) && in_array( $pair[0], self::$attrsAllowed ) ) { - $attribs[$pair[0]] = (isset($attribs[$pair[0]])) ? $attribs[$pair[0]] . ' ' . $pair[1] : $attribs[$pair[0]]; + $attribs[$pair[0]] = (isset($attribs[$pair[0]])) ? $attribs[$pair[0]] . ' ' . $pair[1] : $pair[1]; } }