Please upgrade here. These earlier versions are no longer being updated and have security issues.
HackerOne users: Testing against this community violates our program's Terms of Service and will result in your bounty being denied.

Using/ in discussion does crash the discussion

124»

Comments

  • @Linc said:
    The lack of PCRE unicode support should just make it fall back to non-PCRE parsing, which isn't good for non-ascii characters, but you still wouldn't see spaces and symbols.

    I think i found the bug

    php -a
    php > echo preg_replace('`[\s_[^\w\d]]`', '-', 'lots of spaces ');
    lots of spaces 
    

    That is not a valid expression for what you want.

    grep is your friend.

  • x00x00 MVP
    edited August 2014

    I will file an issue. should be

    '`[\s_]|[^\w\d]`'

    you can simplify to just

    '`[^\w\d]`'

    grep is your friend.

  • balls.

  • AnonymooseAnonymoose ✭✭
    edited August 2014

    @elja said:
    Anonymoose‌ I´am talking about Basic installation. Not about specific wishes or specific changes. I can imagine you need to be programmer when you have specific wishes. Not with a Basic installation.

    There are automobiles that are good for gnu who like to get dirty in the shed with them, and there are carts that raccoons get on a lease to drive around the suburbs with.

  • @Anonymoose said:
    There are automobiles that are good for gnu who like to get dirty in the shed with them, and there are carts that raccoons get on a lease to drive around the suburbs with.

    @Anonymoos
    I do not know if that is an expression. And if Google translates this right. Looks like you have a zoo.

    @Linc
    I do not see addons. Where can I find these?

    @peregrine

    I can read wikipedia about what ssh is. But realy I do not know.

    As far as I understand you ask me to give a direction pcretest -C
    somewhere.

    How can I do that?
    Can I do that with filezilla?

    Please take in account that I´am nota php programmer. And I have NO knowledge of Linux operating system, and appache server.
    And I´am reading an writing in this forum with Google translate open.
    And searching the internet to try to understand what we are talking about here.

  • AnonymooseAnonymoose ✭✭
    edited August 2014

    @elja said:
    And if Google translates this right.

    @Anonymoose said:
    There are automobiles that are good for gnu who like to get dirty in the shed with them, and there are carts that raccoons get on a lease to drive around the suburbs with.

    🐼➡️🏡, 🐼❌🔧🚙. 🐼😧.

    🐃➡️🍃, 🐃💡, 🐃🔧🚲, 🐃🔧🚗. 🐃😄.

  • @link, must I try to give other information?

    Or do I understand well that @x00 has found the problem code

  • In the phpinfo I did find this :
    PCRE (Perl Compatible Regular Expressions) Support enabled

  • peregrineperegrine MVP
    edited August 2014

    As far as I understand you ask me to give a direction pcretest -C somewhere.

    ignore my instructions about pcretext. it won't help anyway.

    But, what you could do is cut and paste this code in your vanilla directory and call it testurl.php
    and then run it from your browser and post your results.

    It will give you some insights into the problem.

    yes, x00 found a bug with platforms without unicode support.

    testurl.php

    <?php

    $Mixed = "/discussion/with a     slash  ///";
    
    $Mixed = strip_tags(html_entity_decode($Mixed, ENT_COMPAT, 'UTF-8'));
    echo "stripped: $Mixed <br />";
    // Test for Unicode PCRE support
    // On non-UTF8 systems this will result in a blank string.
    $UnicodeSupport = (preg_replace('`[\pP]`u', '', 'P') != '');
    // Convert punctuation, symbols, and spaces to hyphens
    if ($UnicodeSupport) {
    $Mixed = preg_replace('`[\pP\pS\s]`u', '-', $Mixed);
    echo "unicode: $Mixed<br />";
    } else {
    $Mixed = preg_replace('`[\s_[^\w\d]]`', '-', $Mixed);
    echo "NOT unicode: $Mixed<br />";
    }
    // Lowercase, no trailing or repeat hyphens
    $Mixed = preg_replace('`-+`', '-', strtolower($Mixed));
    echo "no repeat hypen: $Mixed<br />";
    $Mixed = trim($Mixed, '-');
    echo "trimmed: $Mixed<br />";
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • Output:

    stripped: /discussion/with a slash ///
    NOT unicode: /discussion/with a slash ///
    no repeat hypen: /discussion/with a slash ///
    trimmed: /discussion/with a slash ///

    Can you tell me what this tells you? This output?

  • stripped: /discussion/with a slash /// NOT unicode: /discussion/with a slash /// no repeat hypen: /discussion/with a slash /// trimmed: /discussion/with a slash ///

  • x00x00 MVP
    edited August 2014

    @Linc said:
    balls.

    grep is your friend.

  • peregrineperegrine MVP
    edited August 2014

    Can you tell me what this tells you? This output?

    I believe it means as x00 surmised the url function is causing you an issue.
    And there may be more than one bug, your host server software pcre compilation (full pcre support is not enabled correctly and vanilla code has a bug).

    this is the output that works with php with pcre with unicode support.

    stripped: /discussion/with a slash ///
    unicode: -discussion-with-a-----slash-----
    no repeat hypen: -discussion-with-a-slash-
    trimmed: discussion-with-a-slash
    

    I may not provide the completed solution you might desire, but I do try to provide honest suggestions to help you solve your issue.

  • @elja you shouldn't normally do this but you can patch library/core/class.format.php for the time being.

    search for the line

    $Mixed = preg_replace('`[\s_[^\w\d]]`', '-', $Mixed);
    

    and replace with

    $Mixed = preg_replace('`[^\w\d]`', '-', $Mixed);
    

    grep is your friend.

  • Thank you @x00 .
    I did change the code on the test website
    http://40pkus-reisgenoot.allerbest.nl/

    It looks alright now.

  • Another question.
    I just now understand that it has something to do with Perl
    In my hosting settings I see :
    Services Perl support
    That is not On for this subdomain.
    I can put this to On.
    Could that be helpfull?

  • eljaelja New
    edited August 2014

    Switch Perl setting to On did not help.

    I have other settings:

    Apache ASP support
    SSI support
    PHP support
    CGI support
    Perl support
    Python support
    FastCGI support
    ColdFusion support

    Does one of these settings have to do with it?
    At first only the PHP support was On.
    And now I only did put the Perl support On

  • No. There is nothing further you can do you don't manage the server.

    BTW blocking slashes is the default behaviour fro Apache so nothign usual about it.

    grep is your friend.

  • thanks x00

Sign In or Register to comment.