View Issue Details

IDProjectCategoryView StatusLast Update
0001800OXID eShop (all versions)2. ----- eShop backend (admin) -----public2010-05-06 16:46
Reporterjuergen_busch Assigned To 
PriorityhighSeverityblockReproducibilityalways
Status resolvedResolutionfixed 
Product Version4.3.1 revision 27257 
Fixed in Version4.3.2 revision 27884 
Summary0001800: Admin sites that use the WYSIWYG editor will not be displayed
DescriptionIf the eShop is installed with UTF-8, admin pages with WYSIWYG editor are not displayed. Therefor articles and CMS pages can not be edited, categories only in part.
Additional InformationDetails from Thomas Oppelt of superreal.de:
Error is caused by oxoutput-> addVersionTags.

$sOutput = getStr()->preg_replace("/<\/head>/i", "</head>\n <!-- OXID
eShop {$sEdition}, Version {$sVersion}, Shopping Cart System (c) OXID
eSales AG 2003 - {$sCurYear} - http://www.oxid-esales.com -->",
ltrim($sOutput), 1);

Malformed UTF-8 codes can lead to an error returned by PCRE lib.
TagsNo tags attached.
Attached Files
oxoutput_CE.zip (1,575 bytes)
oxoutput_EE.zip (3,038 bytes)
oxoutput_PE.zip (3,049 bytes)
Theme
BrowserAll
PHP Versionany
Database Versionany

Activities

thomas_oppelt

2010-04-29 15:14

reporter   ~0002602

Last edited: 2010-04-30 00:16

This issue seems to regard PE/EE edition only (WYSIWYG editor presence).

Quick analysis: iUtfMode = 1 leads to use of oxstrmb object returned by getStr() which preg_replace method adds the "u" modifier to replace patterns, that means: If there appeared any malformed utf8 codes in preg_replace input string you get an empty string as result.
As this just happens on editor tabs, we assume the editor code contains malformed utf8 codes or something.

tomas_liubinas

2010-04-30 10:34

reporter   ~0002611

According to user comments on http://php.net/manual/en/function.preg-replace.php

"Be aware that when using the "/u" modifier, if your input text contains any bad UTF-8 code sequences, then preg_replace will return an empty string, regardless of whether there were any matches.

This is due to the PCRE library returning an error code if the string contains bad UTF-8."

However luckily for us we can apply str_replace in this case instead of preg_replace.

tomas_liubinas

2010-04-30 11:13

reporter   ~0002612

Last edited: 2010-05-06 12:47

[EDIT: str_replace() replaced with str_ireplace() in the following solution]

Replaced preg_replace to str_ireplce in oxOutput::addVersionTag() method. New method now is:

final public function addVersionTags( $sOutput )
    {
        // DISPLAY IT
        $sVersion = $this->getConfig()->getVersion();
        $sEdition = $this->getConfig()->getFullEdition();
        $sCurYear = date("Y");

        // Replacing only once per page
        $sOutput = str_ireplace("</head>", "</head>\n <!-- OXID eShop {$sEdition}, Version {$sVersion}, Shopping Cart System (c) OXID eSales AG 2003 - {$sCurYear} - http://www.oxid-esales.com -->", ltrim($sOutput));

        return $sOutput;
    }

dainius.bigelis

2010-05-06 16:45

reporter   ~0002654

Please find the fixed oxoutput.php file (for each edition separately) attached to this bug entry.
File fits for eShop versions 4.3.0 and 4.3.1.