The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

cpanel file manager editing files

Discussion in 'General Discussion' started by knightsfield1, Oct 31, 2003.

  1. knightsfield1

    knightsfield1 Member

    Joined:
    Oct 19, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cpanel file manager editing files - updated to show the problem

    Hi,

    If i use the cpanel (8.5.4-RELEASE #7) file manger to edit html files that contain javascript then any & characters get expanded to & amp (without the space) when edited if they are between the javascript tags and when the file is saved the get saved to disk as &amp

    e.g.
    <script language="JavaScript">
    <!--

    any & contained in code here gets expanded to & amp (witthout the space)

    // -->
    </script>

    Is there anyway to stop this happening?
     
    #1 knightsfield1, Oct 31, 2003
    Last edited: Nov 1, 2003
  2. mickeymouse

    mickeymouse Well-Known Member

    Joined:
    Sep 16, 2003
    Messages:
    389
    Likes Received:
    0
    Trophy Points:
    16
    Dear knightsfield1,

    What characters get expanded to what? & ? I never find any problem with file manager saving special characters inside javascript tags.

    Regards,
     
  3. knightsfield1

    knightsfield1 Member

    Joined:
    Oct 19, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    Hi,

    As an example given the following made up code in a html file:

    <html>
    <body>
    <script language="JavaScript">
    <!--
    if (x && y)
    {
    }
    // -->
    </script>
    </body>
    </html>

    when I use the edit function using the file manager, it gets displayed in the browser IE6 (or opera 7.10) as:
    <html>
    <body>
    <script language="JavaScript">
    <!--
    if (x & amp;& amp; y) *
    {
    }
    // -->
    </script>
    </body>
    </html>

    if i then save the file, and check the file the & characters have been changed to & amp;

    * the actual text has no space between the & and amp but i've no idea how I can display that on here
     
    #3 knightsfield1, Nov 1, 2003
    Last edited: Nov 1, 2003
  4. Ulysses

    Ulysses Well-Known Member

    Joined:
    Oct 17, 2003
    Messages:
    49
    Likes Received:
    0
    Trophy Points:
    6
    G'day knightsfield1

    A client with java on every page of two web hosting accounts with us has reported exactly the same problem.

    We tested File Manager with various browsers, and found there is in fact a bug in the program - probably a WYSIWYG issue.

    The unwanted characters are added to every occurance of the character "&" on the page as soon as you click the "Edit file" option. If you exit "Edit file" screen without saving, the page remains the same. If you hit the "Save" button the errors are saved on the page.

    EXAMPLE (Java extract)

    ++++++ Start ++++++

    if ( browserName == "Netscape" && browserVer >= 3 ) version = "n3";
    if ( browserName == "Microsoft Internet Explorer" && browserVer >=4 ) version = "e4";

    becomes

    if ( browserName == "Netscape" & amp;& amp; browserVer >= 3 ) version = "n3";
    if ( browserName == "Microsoft Internet Explorer" & amp;& amp; browserVer >=4 ) version = "e4";

    ++++++ End ++++++

    We're considering disabling File Manager from all client accounts.

    Shame really. You'd think it would be a relatively simple debug to stop the thing messing with code in a script tag.

    Would appreciate news of any fixes on the horizon.

    Ulysses
     
Loading...

Share This Page