Bug in template_search.php

Discussion in 'ClassiCraft WordPress Theme' started by spottedvarennes, Feb 21, 2015.

  1. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    Hello, when displaying ads excerpts when a user do a search (template_search.php), you are counting the HTML code in the length string count. So sometime the text is too short....because it is calculating the HTML code which is invisible to the user when displaying. Also using this function could break HTML code... I really wonder, why you did this that way...

    here is the code you should change....
    $excerpt = substr( $excerpt, 0, 120 );
     
  2. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
  3. spottedvarennes

    spottedvarennes Member

    Joined:
    Jan 26, 2015
    Messages:
    79
    Likes Received:
    0
    Or simply do this $excerpt = substr( strip_tags($excerpt), 0, 120 );
     

Share This Page