View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0001800 | OXID eShop (all versions) | 2. ----- eShop backend (admin) ----- | public | 2010-04-29 12:45 | 2010-05-06 16:46 |
Reporter | juergen_busch | Assigned To | |||
Priority | high | Severity | block | Reproducibility | always |
Status | resolved | Resolution | fixed | ||
Product Version | 4.3.1 revision 27257 | ||||
Fixed in Version | 4.3.2 revision 27884 | ||||
Summary | 0001800: Admin sites that use the WYSIWYG editor will not be displayed | ||||
Description | If 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 Information | Details 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. | ||||
Tags | No tags attached. | ||||
Attached Files | |||||
Theme | |||||
Browser | All | ||||
PHP Version | any | ||||
Database Version | any | ||||
|
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. |
|
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. |
|
[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; } |
|
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. |