Re: Problem Uploading a File Whose Filename Contains an Apostrophe

  •  08-17-2011, 10:03 AM

    Re: Problem Uploading a File Whose Filename Contains an Apostrophe

    Ken,
     
    I did some searching on the web for this issue and came up with a very good discussion.  Please see:
     
     
    Using the information in this article, I checked the value of 'magic_quotes_gpc' on both my test server and my production server.  The test server value was 'off' while the production server value was 'on'.
     
    When I changed the value of 'magic_quotes_gpc' on my test server to 'on', the (almost) identical truncation of the file name occurred.  The only difference was that on the production server, the truncation of the filename stopped just before the apostrophe, resulting in the uploaded file having a filename of 'Connor.jpg.  On the test server, with 'magic_quotes_gpc = on', the trucation INCLUDED the apostrophe, resulting in the uploaded file having a filename of Connor.jpg.
     
    (I have encountered other examples of my PC-based test server treating apostrophes different from my Linux-based production server.  So that's not an issue for me.)
     
    Bottom line is that it would appear that this "bug" is caused by the setting of 'magic_quotes_gpc' on my production server.
     
    I then turned to my production server and modified the 'magic_quotes_gpc' setting, turning it to 'off'.  Thereafter, files whose filename included an apostrophe uploaded with no problem (other than the misleading display of the filename with the double-quote rather than the apostrophe).
     
    The PHP manual for 'magic_quotes_gpc' says that this setting will be deprecated in PHP 5.3.  I know that it wasn't, since my two test servers use that variable and they are running PHP 5.3.5 and 5.3.6.  But I do understand that it will soon be deprecated.  I am not certain what that effectively means for your code or mine.
     
     
    Questions
     
    1. Do you intend to pursue this issue?
    2. Will I be notified of any changes to your code?
    3. Will you be pursuing a fix for the misleading display of the filename with the double-quote instead of the apostrophe?
     
    Thank you very much.
View Complete Thread