Menu

#71 using amfphp with mbstring.func_overload enabled still fails

open
nobody
None
7
2010-11-02
2010-03-14
Rob Halff
No

I've tried to use amfphp on a server with mbstring.func_overload set to 6.
This leads to the error messages described in this blog post from 2007:

http://www.sephiroth.it/weblog/archives/2007/10/amfphp_and_mbstring.php

This behaviour is still present in the latest release of amfphp.

At least this part seems like deprecated code:
if(!$handled)
{
$uriclasspath = "amfphp/Amf3Broker.php";
$classpath = $baseClassPath . "amfphp/Amf3Broker.php";
$classname = "Amf3Broker";
$methodname = "handleMessage";
}

To recreate this bug, just set mbstring.func_overload to something other than 0.

Maybe also describe somewhere in the documentation that mbstring function overloading should not be activated.

Thanks.

Discussion

  • Rob Halff

    Rob Halff - 2010-03-14
    • summary: mbstring enabled still fails --> using amfphp with mbstring.func_overload enabled still fails
     
  • Alexander Schuch

    Right now I do not see a way to fix this problem using PHP code. The AMF protocol requires lengths to be given in byte, thus strlen() is used. But mbstring overwrites it to mb_strlen(), so that not the byte count but the character count is returned. This obviously leads to problems when using multi-byte characters.

     
  • ariels

    ariels - 2010-10-20

    I wasn't aware of the problem, so thx for the heads up. I dug aroudn though and there doesn't seem to be an easy fix. This will go in the unit tests for v2. So I'll leave the bug open so that we don't drop it then
    Ariel

     
  • Alexander Schuch

    • priority: 5 --> 7
    • labels: 530212 -->
     
MongoDB Logo MongoDB