Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-22366

Canonical URL not shown due to wrong bitwise AND operation on ezpagedata

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Medium Medium
    • 5.3
    • 4.7.0, 5.0, 5.1, 5.2
    • PHP 5.3.10-1ubuntu3.9 with Suhosin-Patch (cli) (built: Dec 12 2013 04:24:43) on Ubuntu 12.04
      PHP 5.3.3-7+squeeze17 with Suhosin-Patch (cli) (built: Aug 23 2013 15:06:16) on Debian 6.0. 7

    Description

      On eZPageData class when checking for display canonical URL if object language is different from siteaccess language, there is a wrong bitwise AND operation between 2 vars that are strings instead of int, causing unexpected result.
      Adding an (int) cast before each var solves the problem, there is a proposed patch:

      --- extension/ezwebin/autoloads/ezpagedata.php	2012-09-07 10:16:19.000000000 +0200
      +++ extension/ezwebin/autoloads/ezpagedata.php	2014-02-18 08:58:48.000000000 +0100
      @@ -236,7 +236,7 @@
                           if ( $siteaccess !== null )
                           {
                               $lang = eZContentLanguage::fetchByLocale( $ini->variable( 'RegionalSettings', 'ContentObjectLocale' ) );
      -                        if ( ( $contentInfo['language_mask'] & $lang->attribute('id') ) < 1 )
      +                        if ( ( (int)$contentInfo['language_mask'] & (int)$lang->attribute('id') ) < 1 )
                               {
                                   $handlerOptions = new ezpExtensionOptions();
                                   $handlerOptions->iniFile = 'site.ini';
      

      Attachments

        Activity

          People

            Unassigned Unassigned
            78425cf8-15d1-497b-8b9e-d1e9f8d91cf3@accounts.ibexa.co Xavier Serna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: