Comments on We're up to a beta now!

  1. Interesting effect

    Peter,
    thank you for your credits! In turn, I appreciate your gratitude, too.

    Here's some info for thinking. It is about nativefs and creating new blogs. I've downloaded the latest version you've released. The problem with creating blogs using nativefs persisted, as it was in the previous version. To figure out, what's happening, I just put some lines

    echo $dir.'br';

    into nativefs.php.

    And the value of this parameter, first passed to the function was

    D:\Apache\Apache2\htdocs\lnblog\D:ApacheApache2htdocs\newblog

    Then I checked out my php.ini file. There was

    magic_quotes_gpc = On

    When I turned them off, everything worked fine.

    The problem in my case was not with permissions, as we've thought. Even there was 'safe_mode=Off' in php.ini.

    So. Is the described effect a thing meant to be? Or?

    Thank you.

  2. some update to the previous

    I have document root explicitly defined in php.ini:

    doc_root = "D:\Apache\Apache2\htdocs"

  3. No Subject

    Notice the line

    Parent: blogentry

    on top of this comments page.

    Is it somehow bound with the fact that there's no text of commented post here?

    P.S. Sorry for dupes.

  4. Concerning the very first comment

    I meant the function mkdir_rec(), because the web-server spitted out a warning, that there's an invalid value passed to this function.

  5. Re: No Subject

    Dupes deleted.

    The "Parent: blogentry" line is there because I didn't remove a debugging statement. I added that to trouble-shoot a problem in the rss1_generator plugin and apparently forgot to remove it. Needless to say, that will go away in the next release. ;-)

  6. Re: Interesting effect

    I think I've found the culprit. Try opening up the lib/blog.php file and changing line 679 from this:
    $this->home_path = stripslashes($this->home_path);
    to this:
    $this->home_path = $this->home_path;
    That should eliminate the problem with creating a new blog.

    As I noted in a comment to a previous post, the stripslashes() function isn't very smart and strips the regular Windows path separators as well. This means that the routine to canonicalize paths didn't see a backslash after the colon and so assumed that the path was relative. That's why it was showing that weird doubling of the path. By simply removing the call to stripslashes(), we remove that problem. Of course, we still have extra backslashes in the path, but a quick review of the path canonicalization function reminded me that it will take care of stripping these for us.

    So, we have several things going on here that created this bug. You probably already know a lot of this, but here's a summary just for the record.

    First, since magic_quotes_gpc cannot be modified inside of PHP code with ini_set(), LnBlog tries to do "the right thing" and fix the input mangled by magic quotes. However, the PHP functions it uses for this don't take into account that the escape character added by magic quotes is the same as the Windows path separator, so they strip those too. This obviously breaks everything that depends on the blog path. The reason you got that strange looking path when you added the echo statement to nativefs.php is because LnBlog tries to automatically convert relative paths into absolute paths, and the lack of backslashes confused that routine into thinking that the mangled path was relative. It therefore prepended the current directory to the path to make it absolute.

    With regards to the PHP doc_root configuration directive, LnBlog does not explicitly use that (although it would be a good default value for DOCUMENT_ROOT, now that you mention it). The internal DOCUMENT_ROOT used by LnBlog is set when the filesystem writing is configured and is used *solely* for converting local paths into URIs. It would be possible to tie DOCUMENT_ROOT to PHP's doc_root, but I'm not sure that's a good idea as I don't know what impact that would have on users in a shared hosting environment. And the behavior in shared hosting environments is a major concern, because that's what *I* use.

    As for server configuration in general, turning off magic_quotes_gpc is definitely good for LnBlog, because it means that the "magic quotes" correction code that caused these problems will not run. (I'm against "magic quotes" in general. It's a hack that only exists to protect users form programmers who don't know what they're doing.) As I state in the LnBlog description, my intent is that the software should run well on cheap shared hosting accounts, which means that it should require as little as possible in terms of server configuration changes. For instance, the entire reason that FTPFS exists is because NativeFS can *only* work when safe_mode is turned off. Therefore, if LnBlog fails to work because of any PHP setting, I consider that a bug.

    Anyway, thanks again for all your help. I'll try to get another beta posted in the next day or so. If all goes well with that one, then I'll clean it up and make it the final version.

Add your comments #

A comment body is required. No HTML code allowed. URLs starting with http:// or ftp:// will be automatically converted to hyperlinks.