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

    • Type: Bug
    • Status: Closed
    • Priority: Medium
    • Resolution: Fixed
    • Affects Version/s: 4.7.0, 5.0, 5.1, 5.2
    • Fix Version/s: 5.3
    • Environment:

      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

            Assignee:
            Unassigned
            Reporter:
            xserna Xavier Serna
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: