Home » Questions » Questions

Posts by demo

1
0 votes

Good question. The answer is actually hard to find.

  • demo answered 6 years ago
1
0 votes

Music the greatest achievement of mankind. I think this is the best answer.

  • demo answered 6 years ago
  • last active 6 years ago
1
0 votes
10k views
Hello from Moscow 🙂
  • demo asked 6 years ago
  • last active 6 years ago
1
0 votes
In reply to: How do you do?

Nice

  • demo answered 6 years ago
1
0 votes
10k views
Testing 123
  • demo asked 6 years ago
  • last active 6 years ago
1
1 vote

Magic Quotes

The following text is taken from PHP.net

http://www.php.net/manual/en/security.magicquotes.why.php

There is no reason to use magic quotes because they are no longer a supported part of PHP. However, they did exist and did help a few beginners blissfully and unknowingly write better (more secure) code. But, when dealing with code that relies upon this behavior it’s better to update the code instead of turning magic quotes on. So why did this feature exist? Simple, to help prevent SQL Injection. Today developers are better aware of security and end up using database specific escaping mechanisms and/or prepared statements instead of relying upon features like magical quotes.

addslashes() vs mysql_real_escape_string()

The reason why you should use mysql_real_escape_string() is because it’s a “MySQL function” and is created especially for escaping user input before it’s executed in a mysql query, while addslashes() is a “PHP function”. That probably sounded a little weird, but there’s one important difference between the two and it has to do with the use of single- and multi-byte characters. You can still inject databases protected by the addslashes function, but injecting databases protected by mysql_real_escape_string is far more difficult. You can read more about it HERE

Register Globals

The reason why you should NOT use register_globals is because variables become accessible to everyone, which means that in the following example you would be able to set $access to true if it hasn’t been initialized before

<?php

if (isAuthenticated()) { $access = true; }

if ($access == true) {
  include(controlpanel.php);
}

?>

The above code would give you sh#! loads of problems, but if we initialize the variable first by adding the following to the top of the page

$access = false;

…we should be fine even if we have register_globals ON

So, if the Wordpress team have initialized all variables (which they probably have) then you don’t have to worry about the use of globals.

Conclusion

It’s definitely bad practice using any of those 3 functions/features and I would never do it myself. Are you sure you’re working with the latest version of Wordpress? Like someone commented, if you are using the latest version it’s because of laziness or worse it’s still in there. I’ld never use Wordpress for anything other than blogs that doesn’t require much security..

NOTE: This answer was originally posted at StackOverflow.com by Tom

  • Ann answered 13 years ago
  • last active 13 years ago
1
0 votes
15k views
The President of the United States (USA) Donald Trump canceled the historic meeting which is plan...
  • demo asked 7 years ago
  • last active 6 years ago
1
0 votes
In reply to: Test
  • demo answered 6 years ago
1
0 votes
1
0 votes
5k views
Prueba # 800Prueba # 800Prueba # 800Prueba # 800Prueba # 800Prueba # 800Prueba # 800Prueba # 800P...
  • demo asked 6 years ago
  • last active 6 years ago
1
0 votes
0 answers
7k views
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nunc sit amet risus imperdiet, viverra l...
  • demo asked 6 years ago
1
0 votes
12k views
  • demo asked 10 years ago
  • last active 10 years ago
1
0 votes

eyg wtf

  • demo answered 8 years ago
1
0 votes

This is a great answer to this type of question

We have severel different elements that could be used

 

  • demo answered 6 years ago
1
0 votes
1
0 votes

howdy cowboy!

  • demo answered 7 years ago
1
0 votes

the answer ias cowboys

  • demo answered 7 years ago
1
0 votes

sadfadfasdf

  • demo answered 6 years ago
1
0 votes
0 answers
16k views
It is a long established fact that a reader will be distracted by the readable content of a page ...
  • demo asked 6 years ago
  • last active 6 years ago
1
0 votes
0 answers
11k views
Hello. I am just testing before buying.
  • demo asked 6 years ago
  • last active 2 years ago
Showing 81 - 100 of 371 results