#14 dash in title

open
nobody
General (15)
5
2004-09-02
2004-09-02
Anonymous
No

When using a dash sign ('-') in the title of a snippet, this
title won't appear in the tree menu on the left side.

My e-mail: peter@eurodaq.com

Discussion

  • mathew
    mathew
    2005-12-25

    Logged In: YES
    user_id=1412373

    If you go to the PHP (or other library folder) and find the
    two files that have a dash in the name, delete the dash from
    the filenames, they will then show up in the menu.
    Apparently, this script does not allow spaces, or any
    punctuation besides _ in the clip names.

    imho the problem line is the regular expression on line 403
    of functions.php, which allows filenames that later cannot
    be recognized:
    $string = ereg_replace("[^A-Za-z0-9\-\_] ", "", $string);

    will work better if changed to:
    $string = ereg_replace("[^A-Za-z0-9\-\_ ]", "", $string);

     
  • mathew
    mathew
    2005-12-26

    Logged In: YES
    user_id=1412373

    my previous post was wrong. :(

    i'm just starting to learn regular expressions, but the
    following seems to work for me... i changed the following
    lines in 'functions.php' and it seems to work fine for me,
    whether or not there is a dash in the name (no need to
    rename files):

    line 403 (moved the space, and shuffled \- around. this
    seems to stop the script saving names that do not show up):

    $string = ereg_replace("[^A-Za-z0-9\_ \-]", "", $string);

    lines 405&406 can be commented out (optional).

    line 455 (this seems to solve the files not showing up
    problem for me):

    $expr = "^($cat\.)([a-z0-9\_]|\-)+($snippet_ext_s)$";