Bug in [more] tag?

2010-11-25
2013-06-03
  • lianergoist
    lianergoist
    2010-11-25

    I have made some changes here and there, so it may be myself messing things up, but I have a problem with the  tag. Please see this page:

    http://www.tj-software.dk/index.php?entry=entry091125-125317

    The link "Læs mere…" is not a link I have made, it just a  tag, and it links to the "add comment" page. If you follow the link, you'll see there are some text after the link, but it is hidden in the main page.

    Can you reproduce this?

    I have also a problem with the links - BASE_URL didn't work for me in 0.70, so I "fixed" it, I thought, but may have introduced new problems. The way I fixed it was to change a few lines in ./scripts/config.php

    define('BASEURL', '/');
    //  if ($_SERVER['SCRIPT_FILENAME'] == realpath($_SERVER['SCRIPT_FILENAME'])) {
    //      define('BASEURL', preg_replace("/^" . str_replace("/", "\/", $_SERVER["DOCUMENT_ROOT"]) . "/", "", ROOT_DIR));
    //  } else {
    //      define('BASEURL', '/' . basename(dirname(dirname(__file__))) . '/');
    //  }
    

    It kind of solved the problems, but permalink points to

    http://www.tj-software.dk/index.php?entry=entry091125-125317/index.php?entry=test-entry

    But maybe that's a bug in the permalink function?

     
  • lianergoist
    lianergoist
    2010-11-25

    Okay, maybe it has nothing to do with permalink. It seems to be this code in ./scripts/sb_display.php:

          if ( ( dirname($_SERVER[ 'PHP_SELF' ]) == '\\' || dirname($_SERVER[ 'PHP_SELF' ]) == '/' ) ) {
            // Hosted at root.
            $base_permalink_url = sb_curPageURL() . '/';
          } else {
            // Hosted in sub-directory.
            $base_permalink_url = dirname(sb_curPageURL()).'/';
          }
    

    The first test condition return true, but the correct path is

    $base_permalink_url = $base_permalink_url = dirname(sb_curPageURL()).'/';
    

    I would just let you know.

     
  • nabber00
    nabber00
    2010-11-29

    Thanks, I fixed this in svn r160.  I replaced that IF/ELSE block with:

    $base_permalink_url = BASEURL;