Code Monkey home page Code Monkey logo

Comments (7)

blowk avatar blowk commented on May 25, 2024

I think it can be done by adding rtrim( ) function when searching for something.
This will remove the space at the end.

At line 569 - file: index.php

if (isset($search)) {
    $search = rtrim($search); // this should remove it. I haven't tested it out.
    $app->getLog()->debug("titlesSlice: search=".$search);
    $tl = $bbs->titlesSlice($index,$globalSettings[PAGE_SIZE],$search);

from bicbucstriim.

rvolz avatar rvolz commented on May 25, 2024

Yes, you both are right. Trimming would help there. I'll add a trim to searches, so that both leading and trailing whitespace will be removed.

from bicbucstriim.

Baldbloke avatar Baldbloke commented on May 25, 2024

blowk, thank you. I've edited index.php as you have written it above. It failed to truncate my search term white space. Probably me doing something wrong though.

rvolz, much appreciated. I wouldn't call it a bug though. Just a user using autocomplete. Thanks for acknowledging.

from bicbucstriim.

rvolz avatar rvolz commented on May 25, 2024

Ok, then we make it an enhancement. If you need the feature urgently change line 571 in index.php from

$tl = $bbs->titlesSlice($index,$globalSettings[PAGE_SIZE],$search);

to

$tl = $bbs->titlesSlice($index,$globalSettings[PAGE_SIZE],trim($search));

That removes leading and trailing whitespace for me. Please note, that this would only change the book search. If you want more you would have to repeat the process for functions authorsSlice, tagsSlice and seriesSlice.

from bicbucstriim.

Baldbloke avatar Baldbloke commented on May 25, 2024

blowk, it was me doing something wrong. I edited the right line but tested incorrectly. Oh well, as I get older, my brain gets smaller.And thank you.

rvolz, Wow. What a gentleman you are also. I've edited titles, authors, tags and series (surprisingly easy to copy and paste - even for me) I've tested it on tags. It works great.

Many, many thanks to you, rvolz and blowk.

from bicbucstriim.

rvolz avatar rvolz commented on May 25, 2024

@Baldbloke, @blowk thx for testing this. I'll add the change to the repo soon.

from bicbucstriim.

blowk avatar blowk commented on May 25, 2024

no problem

from bicbucstriim.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.