Advertisement:

Author Topic: Error 404 when inputting words with / SLASHES \  (Read 1295 times)

nnov05

  • Newbie
  • *
  • Posts: 40
Error 404 when inputting words with / SLASHES \
« on: December 18, 2014, 09:03:09 am »
When I include slash(of course for testing purposes) It gives me error 404 not found even I sanitize input using osc_esc_html or even using stripslashes and mysql_real_escape_string. Can anyone help me :( ?

design

  • Hero Member
  • *****
  • Posts: 2619
  • Osclass 3.5 MAC/PC w/ Modern Browsers
Re: Error 404 when inputting words with / SLASHES \
« Reply #1 on: December 18, 2014, 07:02:31 pm »
why do you need the slash?

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Error 404 when inputting words with / SLASHES \
« Reply #2 on: December 19, 2014, 04:14:20 am »
Hi nnov05,
where do you include slashes - describe this a little? In title and description? It works fine for me.

p.s. mysql_real_escape_string has an obsolete status and will be removed from future PHP versions, alternative is mysqli_real_escape_string

Regards

nnov05

  • Newbie
  • *
  • Posts: 40
Re: Error 404 when inputting words with / SLASHES \
« Reply #3 on: January 09, 2015, 10:53:22 am »
Sorry guys if i responded so late. actually it only happens when i inputted [slashes] on my search inputs when friendly urls are enabled on the permalink settings.

Hi nnov05,
where do you include slashes - describe this a little? In title and description? It works fine for me.

p.s. mysql_real_escape_string has an obsolete status and will be removed from future PHP versions, alternative is mysqli_real_escape_string

Regards

dev101 : ok I will try that. for now i just disabled friendly urls to avoid this error. but please it's a critical part of osclass components. i hope they'll fix this. It also happens on the latest version of osclass 3.5.3. Thanks comrade for your response.

why do you need the slash?


design : Mr. design actually I don't need the slash. I just inputted it for testing purposes so that I can assure that the search input has no errors and query the inputted word correctly.

P.S. --> I never changed any of the core files or the function of the search.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Error 404 when inputting words with / SLASHES \
« Reply #4 on: January 09, 2015, 02:49:34 pm »
I understand now, and this seems to be a known issue with Apache. There are some workarounds, the easiest one being apache directive AllowEncodedSlashes which does not work properly with Osclass or does not always work in my case. Since search uses / as separators in for readability instead, this might be the problem. It is not an issue in the item titles and their URLs because they are sanitized (removed any slash) and this is not affecting search results. But, if the word contains slash in the middle of the word, that will change it's meaning and defy the purpose. Not sure how to approach this, probably the url encoding substitution might be the best solution. Issue is here: #1797

Regards

nnov05

  • Newbie
  • *
  • Posts: 40
Re: Error 404 when inputting words with / SLASHES \
« Reply #5 on: January 13, 2015, 06:27:08 am »
I understand now, and this seems to be a known issue with Apache. There are some workarounds, the easiest one being apache directive AllowEncodedSlashes which does not work properly with Osclass or does not always work in my case. Since search uses / as separators in for readability instead, this might be the problem. It is not an issue in the item titles and their URLs because they are sanitized (removed any slash) and this is not affecting search results. But, if the word contains slash in the middle of the word, that will change it's meaning and defy the purpose. Not sure how to approach this, probably the url encoding substitution might be the best solution. Issue is here: #1797

Regards

@dev101
Hello comrade! Thanks for another healthy response on my issue. Can you take me where can i learn url encoding substitution. I found one technique using rawurlencode right now and I will try this if this would fix this search issue. I'll post right away for the result.

dev101

  • Osclass Hero
  • Hero Member
  • *
  • Posts: 2155
  • osclass.work
Re: Error 404 when inputting words with / SLASHES \
« Reply #6 on: January 13, 2015, 06:56:58 am »
This issue has to be reviewed by core devs, it is not the url encoding itself that creates the problem in the first place, but the fact that in Osclass / has a special meaning for separation of the search parameters combined with the security feature of Apache. If you disable that security within config directive in Apache, you end up with another problem: apparently Osclass does not know where the search pattern begins and where the next block starts, so it gets reset and you end up with all results. I have tried to change few things, still not working. The easiest way would be to simply strip any slash from the search input, not ideal but best I can think of.

Regards