ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Word Limiter plugin not limiting the words in some cases..

April 25, 2008 2:28pm

Subscribe [2]
  • #1 / Apr 25, 2008 2:28pm

    Dan Lewis

    24 posts

    This question may be related to a resolved thread.

    I experience a similar problem as the thread describes.  That is, it doesn’t restrict the words in some cases and show the full length instead.  This doesn’t happen on my local PC but only starts to show up on my live server.

    Both my weblog and output HTML header use charset: UTF-8 to begin with.  I can trace down to the issue is with the actual PHP function call

    preg_split('/\s/u', $str, -1, PREG_SPLIT_NO_EMPTY)

    When I pass the full string, it returns as one word.  It doesn’t split the words at all.

    To get around the problem, I am now using Char Limiter and it seems to get the job done.  But I am interested to know what’s the problem, I think someone in the thread mentions it has something to do with the encoding but I don’t quite follow where to look into.  Thanks.

  • #2 / Apr 25, 2008 6:48pm

    Ingmar

    29245 posts

    As Derek said, have you tried removing the /u modifier? (Just the u, leave the slash). Does that change anything?

  • #3 / Apr 25, 2008 7:30pm

    Dan Lewis

    24 posts

    Great, it works by removing the u.  Does it imply my server has some unicode compatibility issues? 

    I try to avoid making changes in core functions if possible so I will stay with Char Limit plugin for now.  May be this can be incorporated to EE’s next release if it won’t affect the others….

  • #4 / Apr 25, 2008 7:38pm

    Ingmar

    29245 posts

    See this posting for a bit of an explanation.

  • #5 / Apr 25, 2008 8:31pm

    Dan Lewis

    24 posts

    PHP Version 5.1.2-1

    PCRE (Perl Compatible Regular Expressions) Support   enabled
    PCRE Library Version   6.4 05-Sep-2005

    I don’t see any compile lines in PHP info at all.

  • #6 / Apr 29, 2008 4:23pm

    Ingmar

    29245 posts

    Dan, do you still consider this an issue? Is it working for you now?

  • #7 / Apr 29, 2008 6:14pm

    Dan Lewis

    24 posts

    Yes, it works for me by either removing u modifier in the core function or use Char Limit plug-in.  I don’t see any compile lines referencing regex (—with-regex) in phpinfo().  In fact, I don’t see any compile line at all.  Does it imply an isolated server’s issue?

    Or this is a more general issue that the core function should remove ‘u’ modifier to work with more servers….

    Anyway, I guess this issue can be considered closed.  Thanks.

  • #8 / Apr 29, 2008 6:22pm

    Ingmar

    29245 posts

    Dan, thank you for you feedback, we’ll take that into consideration. Closing for now.

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases