summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormomo-i <momo-i@ampache>2009-05-27 22:30:05 +0000
committermomo-i <momo-i@ampache>2009-05-27 22:30:05 +0000
commitf7ddaf7f4ca82fc20c8fec474c0f832bd20e658f (patch)
tree35716a589bfa04ef7d3444e44dece0d91eba97bc
parente3e5fb3510cedefbbc9881824a42cc69acbe8df7 (diff)
downloadampache-f7ddaf7f4ca82fc20c8fec474c0f832bd20e658f.tar.gz
ampache-f7ddaf7f4ca82fc20c8fec474c0f832bd20e658f.tar.bz2
ampache-f7ddaf7f4ca82fc20c8fec474c0f832bd20e658f.zip
fixed #479 if PHP version is 5.3.0 or larger, don't use magic_quotes.
-rw-r--r--lib/general.lib.php3
-rw-r--r--play/index.php5
2 files changed, 6 insertions, 2 deletions
diff --git a/lib/general.lib.php b/lib/general.lib.php
index 73f488bb..ef776d93 100644
--- a/lib/general.lib.php
+++ b/lib/general.lib.php
@@ -214,7 +214,8 @@ function generate_password($length) {
*/
function scrub_out($str) {
- if (get_magic_quotes_gpc()) {
+ //This feature has been DEPRECATED as of PHP 5.3.0
+ if(version_compare(PHP_VERSION, '5.3.0', '<=') AND get_magic_quotes_gpc()) {
$str = stripslashes($str);
}
diff --git a/play/index.php b/play/index.php
index 4a3a5b8c..99fdfcac 100644
--- a/play/index.php
+++ b/play/index.php
@@ -226,7 +226,10 @@ if (!$media->file OR !is_readable($media->file)) {
}
// make fread binary safe
-set_magic_quotes_runtime(0);
+// This feature has been DEPRECATED as of PHP 5.3.0
+if(version_compare(PHP_VERSION, '5.3.0', '<=')) {
+ set_magic_quotes_runtime(0);
+}
// don't abort the script if user skips this song because we need to update now_playing
ignore_user_abort(TRUE);