Skip to content

Commit

Permalink
Call to undefined function get_magic_quotes_gpc()
Browse files Browse the repository at this point in the history
  • Loading branch information
exstreme committed Sep 19, 2021
1 parent 5faea26 commit 8ce8b50
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 15 deletions.
18 changes: 9 additions & 9 deletions administrator/install/sql/install.mysql.utf8.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ CREATE TABLE IF NOT EXISTS `#__jcomments` (
`level` TINYINT(1) UNSIGNED NOT NULL DEFAULT '0',
`object_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`object_group` VARCHAR(255) NOT NULL DEFAULT '',
`object_params` TEXT NOT NULL DEFAULT '',
`object_params` TEXT,
`lang` VARCHAR(255) NOT NULL DEFAULT '',
`userid` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`name`VARCHAR(255) NOT NULL DEFAULT '',
`username`VARCHAR(255) NOT NULL DEFAULT '',
`email` VARCHAR(255) NOT NULL DEFAULT '',
`homepage` VARCHAR(255) NOT NULL DEFAULT '',
`title` VARCHAR(255) NOT NULL DEFAULT '',
`comment` TEXT NOT NULL DEFAULT '',
`comment` TEXT,
`ip` VARCHAR(39) NOT NULL DEFAULT '',
`date` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
`isgood` SMALLINT(5) NOT NULL DEFAULT '0',
Expand Down Expand Up @@ -43,7 +43,7 @@ CREATE TABLE IF NOT EXISTS `#__jcomments_settings` (
`component` VARCHAR(50) NOT NULL DEFAULT '',
`lang` VARCHAR(20) NOT NULL DEFAULT '',
`name` VARCHAR(50) NOT NULL DEFAULT '',
`value` TEXT NOT NULL DEFAULT '',
`value` TEXT,
PRIMARY KEY (`component`, `lang`, `name`)
) DEFAULT CHARSET=utf8;

Expand Down Expand Up @@ -91,12 +91,12 @@ CREATE TABLE IF NOT EXISTS `#__jcomments_custom_bbcodes` (
`id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
`name` VARCHAR(64) NOT NULL DEFAULT '',
`simple_pattern` VARCHAR(255) NOT NULL DEFAULT '',
`simple_replacement_html` TEXT NOT NULL DEFAULT '',
`simple_replacement_text` TEXT NOT NULL DEFAULT '',
`simple_replacement_html` TEXT,
`simple_replacement_text` TEXT,
`pattern` VARCHAR(255) NOT NULL DEFAULT '',
`replacement_html` TEXT NOT NULL DEFAULT '',
`replacement_text` TEXT NOT NULL DEFAULT '',
`button_acl` TEXT NOT NULL DEFAULT '',
`replacement_html` TEXT,
`replacement_text` TEXT,
`button_acl` TEXT,
`button_open_tag` VARCHAR(16) NOT NULL DEFAULT '',
`button_close_tag` VARCHAR(16) NOT NULL DEFAULT '',
`button_title` VARCHAR(255) NOT NULL DEFAULT '',
Expand Down Expand Up @@ -147,7 +147,7 @@ CREATE TABLE IF NOT EXISTS `#__jcomments_objects` (
`category_id` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`lang` VARCHAR(20) NOT NULL DEFAULT '',
`title` VARCHAR(255) NOT NULL DEFAULT '',
`link` text NOT NULL DEFAULT '',
`link` TEXT,
`access` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
`userid` INT(11) UNSIGNED NOT NULL DEFAULT '0',
`expired` TINYINT(3) UNSIGNED NOT NULL DEFAULT '0',
Expand Down
2 changes: 1 addition & 1 deletion administrator/models/comment.php
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public function save($data)
$table->email = $user->email;
}

if (get_magic_quotes_gpc() == 1) {
if (!function_exists('get_magic_quotes_gpc') || get_magic_quotes_gpc() == 1) {
$table->title = stripslashes($table->title);
$table->comment = stripslashes($table->comment);
}
Expand Down
2 changes: 1 addition & 1 deletion administrator/models/custombbcode.php
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public function save($data)
$table->button_image = trim(strip_tags($table->button_image));
$table->button_css = trim(strip_tags($table->button_css));

if (get_magic_quotes_gpc() == 1) {
if (!function_exists('get_magic_quotes_gpc') || get_magic_quotes_gpc() == 1) {
$table->pattern = stripslashes($table->pattern);
$table->replacement_html = stripslashes($table->replacement_html);
$table->replacement_text = stripslashes($table->replacement_text);
Expand Down
2 changes: 1 addition & 1 deletion administrator/models/settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ public function save($data)
}
}

if (get_magic_quotes_gpc()) {
if (!function_exists('get_magic_quotes_gpc') || get_magic_quotes_gpc()) {
$value = stripslashes($value);
}

Expand Down
6 changes: 3 additions & 3 deletions site/jcomments.ajax.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,13 @@ public static function prepareValues( &$values )
$v = trim(strip_tags($v));

// handle magic quotes compatibility
if (get_magic_quotes_gpc() == 1) {
if (!function_exists('get_magic_quotes_gpc') || get_magic_quotes_gpc() == 1) {
$v = stripslashes($v);
}
$v = JCommentsText::nl2br($v);

foreach ($tmp as $key => $code) {
if (get_magic_quotes_gpc() == 1) {
if (!function_exists('get_magic_quotes_gpc') || get_magic_quotes_gpc() == 1) {
$code = str_replace('\"', '"', $code);
$code = str_replace('\'', "'", $code);
}
Expand All @@ -67,7 +67,7 @@ public static function prepareValues( &$values )
$values[$k] = trim(strip_tags($v));

// handle magic quotes compatibility
if (get_magic_quotes_gpc() == 1) {
if (!function_exists('get_magic_quotes_gpc') || get_magic_quotes_gpc() == 1) {
$values[$k] = stripslashes($values[$k]);
}

Expand Down

0 comments on commit 8ce8b50

Please sign in to comment.