Problem on keywords

I have a problem with OJS Keywords when I write Plus sign (+) on a keyword it saves space (-) saved without problem only (+) not saved for example:
Combined the (1+3)

it saves as

Combined the (1 3)

when going to the database and adding (+) on a keyword it works fine
but if I save the metadata of an article or publish the article it saves space not (+)

  • Application Version - OJS
  • Server Information
    PHP version 7.4
    Apache version LiteSpeed
    Database driver mysqli
    Database server version 10.4.19-MariaDB-cll-lve
1 Like

Hi @swite2331,

Thanks for your post. Not sure what’s going on here, I was able to do this and couldn’t replicate your issue:

Screen Shot 2022-09-10 at 8.26.50 AM

I was entering it as part of an initial new submission - is this where you were entering it as well?

PKP Team

Yes, there is where I entered it, and finish the submission.
know go to review the submission publication metadata and see Keywords saved in it

Can anyone help me in this problem, please

Hi @swite2331,

Sorry for the delay - I was not able to reproduce your issue. Can you perhaps share a screenshot of how it appears in your journal?

PKP Team

I have an example to my problem.
submit article and fill all information

when done and publish the article this what is view in site

In Metadata when save keywords the + saved in database as space
to fix my problem I go to my database change space to +


1 Like

But i want to know is this problem only to me or is there anyone have it
And if there fix to it.

Hi @swite2331,

This is happening because the API treats incoming data as being URL-encoded. Before the keyword is stored in the database, the data is passed into PHP’s urldecode function which turns the URL-encoded “+” into a space.

For reference, this happens here in the code:

To have a plus sign be correctly saved, it must first be URL-encoded, which in this case is %2b. So to have 1+3 saved in the database and correctly decoded, it would need to be written as 1%2b3.

Hope that helps.


PKP Team