View Issue Details

IDProjectCategoryView StatusLast Update
0006928OXID eShop (all versions)1.01. Products (product, categories, manufacturer, promotions etc.)public2021-06-07 12:48
Status acknowledgedResolutionopen 
Product Version6.0.2 
Target VersionFixed in Version 
Summary0006928: Categorienames at the end of an url consisting only of digits are interpreted as page numbers
DescriptionSuppose to have a category structure like batterie/2032/ then clicking to this categorie the shop will make an redirect to batterie/

This happens in Controller/ArticleListController.php in function _checkRequestedPage():

        if ($pageCount && (($pageCount - 1) < $currentPageNumber)) {
            \OxidEsales\Eshop\Core\Registry::getUtils()->redirect($this->getActiveCategory()->getLink(), false);

the interpretion of digits in an url only as page number happens in Core/SeoDecoder.php, function extractPageNumberFromSeoUrl($seoUrl). With this grep pattern all numbers become page numbers:

preg_match('/(.*?)\/(\d+)\/(.*)/', $seoUrl, $matches)

We think at this point the software has to check if the number ist an exsting category.
Tags404, Category, Redirect
ThemeNot defined
BrowserNot defined
PHP VersionNot defined
Database VersionNot defined



2018-12-04 14:21

administrator   ~0012718


as this is a specific use case I changed the entry to a feature request, so our PM can check it. Also because the shop is working as intended: Digits at the end of an URL are to interpreted as page numbers.
In the meantime I suggest to give the category a prefix to identify them as a category and not as a page number like ""

Kind regards,



2019-09-02 13:20

reporter   ~0012970

Why is that a feature? Categories can be created with number names and create exactly this SEO address without error message. The call of this generated SEO address then no longer works. The definition of a specific case does not necessarily exclude the definition as a (rare) bug.

By the way: In shop version 4.7, these SEO addresses also worked with page switches.



2021-06-07 12:48

reporter   ~0013448

The following change was sufficient for our purposes:

Core/SeoDecoder.php (row 350 ss)

private function extractPageNumberFromSeoUrl($seoUrl)
        $oDb = \OxidEsales\Eshop\Core\DatabaseProvider::getDb();
        $shopid = $this->getConfig()->getShopId();
        $sSelect = "select oxobjectid from oxseo where oxseourl LIKE '%{$seoUrl}%' and oxshopid = '{$shopid}' LIMIT 1";
        $sOxobjectid = $oDb->getOne($sSelect);
                $pageNumber = null;
        if (1 === preg_match('/(.*?)\/(\d+)\/(.*)/', $seoUrl, $matches) && !$sOxobjectid) {
            $seoUrl = $matches[1] . '/' . $matches[3];
            $pageNumber = $this->convertSeoPageStringToActualPageNumber($matches[2]);
        return [$seoUrl, $pageNumber];