Bug #959

Magic Quotes Check

Added by Matt Rogowski over 1 year ago. Updated over 1 year ago.

Status:Closed Start date:05/21/2010
Priority:Normal Due date:
Assignee:Ryan Gordon % Done:

100%

Category:PHP
Target version:1.4.14
Reproducibility:Always Database Type:
Reported In MyBB Version:1.4.13 Database Version:
PHP Version: SQA assignments:
Browser:

Description

Forgive me if I'm being completely stupid here.

if(version_compare(PHP_VERSION, '5.3', '<'))

Is this not saying to only do this if it's less than 5.3?? Should it not be this??

if(version_compare(PHP_VERSION, '5.3', '>='))

Then it'd run it if it's greater than or equal to 5.3, which is what we'd want it to do.

I'm running 5.3, I echo'd some text inside this if statement, didn't echo, made my change, and it echo'd, so it wasn't being run originally.

Associated revisions

Revision 4952
Added by Ryan Gordon over 1 year ago

Fixes Magic Quotes Check (fixes:959)

History

Updated by Tom Moore over 1 year ago

Uhm, this might be me being think, but magic_quotes is deprecated in 5.3, so we only need to run that code if the PHP version is anything less than...

Updated by Matt Rogowski over 1 year ago

Thought something didn't quite add up, but isn't all that code there to try and disable magic quotes?? Because a lot of hosts on 5.3.x still have it enabled and it causes problems.

Saying that it didn't solve the \' and \" issue even when it did run the code.

Updated by Stefan T. over 1 year ago

We don't need a check here, because we can ignore deprecated warnings...

Updated by Dennis Tsang over 1 year ago

I think what Matt's trying to say is that magic quotes only is deprecated, not removed. This means that the functionality of Magic Quotes still works the same way as before; the usage of it is just discouraged.

However, magic quotes is removed in PHP6 I believe. The check should be for that version since the magic quote functions would have been removed by then.

Updated by Ryan Gordon over 1 year ago

Can someone find the original ticket for that change?

Updated by Ryan Gordon over 1 year ago

How big of an issue is this Matt? Would it require us to do a quick 1.4.14 (PHP 5.3 compatibility release)?

Updated by Ryan Gordon over 1 year ago

  • Category set to PHP
  • Status changed from New to Assigned
  • Assignee set to Ryan Gordon
  • Target version set to 1.6.0 Beta 2
  • Reported In MyBB Version changed from 1.6.0 to 1.4.13

Updated by Matt Rogowski over 1 year ago

There's about a thread a day on it. Would probably be a good idea to make the change for 1.4 too for people who stay on it after 1.6 is released.

To be honest I don't know why I didn't check this code before, feel rather stupid.

Updated by Ryan Gordon over 1 year ago

  • Status changed from Assigned to Resolved
  • % Done changed from 0 to 100

Applied in changeset r4952.

Updated by Ryan Gordon over 1 year ago

  • Target version changed from 1.6.0 Beta 2 to 1.4.14

Updated by Stefan T. over 1 year ago

  • Status changed from Resolved to Closed

Also available in: Atom PDF