WordPress.org

Ready to get started?Download WordPress

Forums

Cant edit a theme (22 posts)

  1. XeroCool
    Member
    Posted 9 years ago #

    I cant edit a theme in my 1.5. I clicked Theme Editor and all I get is:

    Sorry, that file cannot be edited.

    All my files are 777. ?

    I activated another theme, same message.

  2. XeroCool
    Member
    Posted 9 years ago #

    I deleted my cookies, cache, etc..still nothing. :\

  3. UsmanLaw
    Member
    Posted 9 years ago #

    Go to your file manager through your servers control panel and make sure the files are writable.

  4. feanor
    Member
    Posted 8 years ago #

    i just upgraded to version 2.0.4 and now have the same problem with a theme I've been able to edit in 2.0.4. All the files including the theme directory are 777.

  5. moshu
    Member
    Posted 8 years ago #

    Directory - 777, files should be 666.
    (and because you'll not change back them after every small edit, you'll leave your blog completely vulnerable for any hacker out there. Don't use it. Edit the template files on your computer!)

  6. trasnam
    Member
    Posted 8 years ago #

    I noticed this is a regression present with 2.0.4 and 2.1 Alpha 2. The theme that was causing a problem has brackets in the directory name(for example, themename[modification]), and for some reason upon clicking "Update File," the brackets are stripped out of the $files variable. Because of this, the value for $files doesn't match the value present in $allowed_files and the function validate_file returns 3, which in turn results in validate_file_to_edit doing a "die(__('Sorry, that file cannot be edited.'));". All of these variables I am referring to are in admin-functions.php.

    I haven't been able to track down yet where the brackets are stripped out, but it has to be something new to 2.0.4 and 2.1 Alpha 2. I tried fresh installs of 2.0.3, 2.0.4, and 2.1 Alpha 2, and 2.0.3 is the only installation that works properly.

    As a workaround, I renamed the theme directory to not have any brackets in it.

    I plan on posting a bug report shortly.

    feanor, does your theme's directory happen to have brackets in it, or is my issue completely unrelated?

  7. moshu
    Member
    Posted 8 years ago #

    Maybe having brackets in a directory name is not the wisest thing to do...

  8. spencerp
    Member
    Posted 8 years ago #

    There really isn't much need for brackets in a directory name..!? What's the point of it anyways..? =/

    It's bad enough now, helping people upload their themes properly..sigh.. Brackets would just add to the problem even more. [rolls eyes]..people..I tell ya lol!

    spencerp

  9. trasnam
    Member
    Posted 8 years ago #

    Last time I checked, a bracket is a valid text character for use in a file/directory. If I have a valid directory name, it should be handled correctly.

    Previous comments are basically saying parenthesis or underscores shouldn't be handled either since there isn't "much need" for them. Just because something is seldom used does not mean it shouldn't be handled correctly.

    Anyways, the bug report is filed.

    I know it's somewhat rare to use a bracket, but if WordPress isn't going to handle the use of brackets properly, it should at least prompt the user to rename the directory to something that WordPress finds acceptable. If this isn't the case, then it is a bug, plain and simple, and should be addressed.

  10. trasnam
    Member
    Posted 8 years ago #

    I posted the bug report to the following page:

    http://trac.wordpress.org/ticket/2994

    I later found out where the troublesome code is, which you can see from the above link is a section of code in wp-includes/pluggable-functions.php .

    For those having problems, the easiest fix for now would be to rename the directory that is causing the issues. Otherwise, either revert to the 2.0.3 code in pluggable-functions.php (as mentioned in the bug ticket link above), or wait until the devs officially fix the problem.

  11. amykay
    Member
    Posted 8 years ago #

    no offense, but moshu and spencerp, maybe you could can the sarcasm and holier-than-thou attitude when trying to help some of us in the forums. There are quite a few people who are new at this and might not understand why you shouldn't have your files set at 777 or why putting prackets in file names "is not the wisest thing to do..."

    just my two cents.

  12. feanor
    Member
    Posted 8 years ago #

    Trasnam, I know I'm going to sound totally noobish here, but I'm not entirely sure what you mean.

    The theme in question is ChaoticSoul v.1.0 (as displayed in the themes dir). Here's the odd thing - even after getting the error, when I look at the template file I just edited and got the error on, the changes are saved...

    Let me know where/what to look for and I'll be happy to provide any information I can.

    Just as a point of reference, the two themes that come default with WP (classic and default) both work with no problems.

    And as a side note, I didn't leave my dir at 777 :) I was just trying to state that changing perms didn't help with the problem.

  13. trasnam
    Member
    Posted 8 years ago #

    feanor,

    Unfortunately this problem not only affects brackets. It affects spaces also (among other characters, like parenthesis, for instance).

    I suggest for now to rename the directory to ChaoticSoul, or ChaoticSoul_v1.0.0 or the like. It should then work properly.

    It all comes down to the preg_replace line in wp-includes/pluggable-functions (that I mentioned in the bug ticket) that limits what characters are allowed. Apparently this fixes some IIS bug, but messes things up for us.

  14. feanor
    Member
    Posted 8 years ago #

    trasnam - worked like a charm. simple fix (without being a coder, i tend to like those the best).

  15. trasnam
    Member
    Posted 8 years ago #

    feanor,

    I'm glad I could help. Who would have thought that something as innocent as a space in the directory name would be causing the problem?

  16. spencerp
    Member
    Posted 8 years ago #

    This "fix" *might* make it into the SVN branch/ and trunk/, but..won't be publically accessible per se..unless they add it quick, some how into the downloadable zip or tar for 2.0.4. =/ (And of course..the people that know how to grab the SVN copies lol..but, it's cool though. )

    But, I'll check out the "fix" or whatever then k. =) See what happens.. =p Congrats on taking this upon yourself.. =)

    spencerp

  17. trasnam
    Member
    Posted 8 years ago #

    spencerp,

    I don't exactly have a real fix, since I doubt just replacing the trunk/branch code with 2.0.3 code would be a proper fix. Obviously the change was made for a reason, so it probably fixed something with the IIS cookie bug that wasn't properly fixed in 2.0.3.

    As it stands now, I'm not sure what to do to properly fix it. If I understood more about that IIS cookie bug (that is addressed by the code), maybe I'd have a good fix.

    I'll definitely keep track of the bug though, and see if anybody has any ideas to make sure the code works properly for all users.

    One thing to note though is that the stripping code only runs upon clicking "Update File" on the Theme Editor page. Before this point, both $file and $files_allowed have matching values for the file being edited. I'm not sure if that helps at all, but figured I'd mention it. Maybe that stripping code can just not be called upon submission somehow?

    If I think of anything else, I'll be sure to post it to the bug ticket.

  18. yosemite
    Member
    Posted 8 years ago #

    Brackets were frequently used in paths fed to servers (FTP, HTTP, etc.) in an attempt to inject scripts/commands.

    The fact that it's acceptable to use on a local filesystem isn't the same as acceptable "in the wild".

  19. spencerp
    Member
    Posted 8 years ago #

    trasnam, Oh ok! I didn't check out your ticket and must have misunderstood ya then... No wait, it's because I'm going on -24 hours sleep.. that's what it is lol!! =p =)

    spencerp

  20. BarryE
    Member
    Posted 8 years ago #

    Not wanting to sound stupid but...I would like to remove the menu on my site - http://www.blog.futurebright.com.au titled Meta and all items in this menu, ie login, rss, comments rss, valid xhtml, xfn, wp. Can anyone help with this, also, why are they there in the first place. Thanks

  21. spencerp
    Member
    Posted 8 years ago #

    BarryE, can you post a new thread please? This will keep down the confusion for the Original Poster here.. ;) Thanks. =)

    You can go here:
    http://wordpress.org/support/forum/5

    Scroll to bottom of page, and then fill out the form and fields.. =)

    spencerp

  22. shantanu20
    Member
    Posted 8 years ago #

    Trasnam,
    Your suggestion re. removing the spaces worked for me too. Thanks for resolving an exasperating situation.
    Shantanu

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.