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

ez4 stock attribute image with a name strange in a chinese name object

    XMLWordPrintable

Details

    • Icon: Bug Bug
    • Resolution: Duplicate
    • Icon: Medium Medium
    • None
    • 4.0.0
    • None
    • Operating System: WinXP Fr
      PHP Version: PHP5.2.4

    Description

      When i upload a image attribute in a object with a chinese name, the image is created with a name strange in system. But in database, the name is correct in chinese.
      So it can't find the image in BO because the name is not correct in system.

      I look in the file kernel/classes/datatypes/ezimage/ezimagealiashandler.php

      function imageName( $contentObjectAttribute, $contentVersion, $language = false )
      {
         ...
      $objectName = $contentVersion->versionName( $language );
         ...
      }
      

      The image name is the object name (chinese charset)

      i tested in the file lib/ezutils/classes/ezhttpfile.php

      if ( !move_uploaded_file( $this->Filename, $dest_name ) )
      

      the $dest_name is in chinese. But after the file created, the name is changed like a codage strange.

      My solution : give the image name by obj_id and obj_version
      i changed the code in kernel/classes/datatypes/ezimage/ezimagealiashandler.php

      //for function imageName and imageNameByNode
      //added by LIU Bin for the chinese image name
              if ( is_object( $contentObjectAttribute ) ) 
              {
              	$objectName = $contentObjectAttribute->attribute('id')."_".$contentObjectAttribute->attribute('version');      
              }
              else
              {
                  $objectName = $contentObjectAttribute['id']."_".$contentObjectAttribute['version'];
              }
      

      Somebody has a better solution ??? Thanks

      Attachments

        Activity

          People

            unknown unknown
            robin_liu robin_liu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: