Skip to content

Commit

Permalink
Fix EZP-21336: In IE8, every publish adds another empty paragraph at …
Browse files Browse the repository at this point in the history
…the end
  • Loading branch information
dpobel committed Aug 6, 2013
1 parent c6f4d73 commit 36a8093
Showing 1 changed file with 14 additions and 5 deletions.
19 changes: 14 additions & 5 deletions extension/ezoe/ezxmltext/handlers/input/ezoexmlinput.php
Original file line number Diff line number Diff line change
Expand Up @@ -588,11 +588,20 @@ function validateInput( $http, $base, $contentObjectAttribute )
if ( $lastChild && $lastChild->nodeName === 'paragraph' )
{
$textChild = $lastChild->lastChild;
// $textChild->textContent == " " : string(2) whitespace in Opera
if ( !$textChild ||
( $lastChild->childNodes->length == 1 &&
$textChild->nodeType == XML_TEXT_NODE &&
( $textChild->textContent == " " || $textChild->textContent == ' ' || $textChild->textContent == '' || $textChild->textContent == ' ' ) ) )
if (
!$textChild ||
(
$lastChild->childNodes->length == 1 &&
$textChild->nodeType == XML_TEXT_NODE &&
(
$textChild->textContent == " " || // that's a non breaking space (Opera)
$textChild->textContent == ' ' ||
$textChild->textContent == '' ||
$textChild->textContent == ' ' ||
$textChild->textContent == "\xC2\xA0" // utf8 non breaking space
)
)
)
{
$parent->removeChild( $lastChild );
}
Expand Down

0 comments on commit 36a8093

Please sign in to comment.