[campsite-dev] campsite-3.0.0-Beta2 - some site names fail.
  • There is a bug at template_engine/classes/CampURIShortNames on line 333 in function setURL

    333: $alias = ltrim($this->getBase(), $this->getScheme().'://');

    if the scheme is 'http', ltrim treats it's second argument as an array of chars to be stripped from the string. So if your sitename starts with one or more 'h', or 't', or a 'p', it fails with messages like

    "Notice: Campsite error: not valid site alias in /var/www/campsite/html/template_engine/classes/CampTemplate.php on line 119"

    e.g. you cannot publish a site alias called pub1.

    My fix was a longwinded replacement ...
    $alias = ltrim($this->getBase());
    $scheme = $this->getScheme().'://';
    $n = strlen($scheme);
    if (strncasecmp($alias, $scheme, $n)==0)
    {
    $alias = substr($alias, $n);
    }


    peter