com web/php: Goodbye Magic Quotes: include/langchooser.inc include/prepend.inc manual-lookup.php manual/add-note.php search.php submit-event.php
| From: | Sara Golemon | Date: | Wed, 10 Jul 2019 17:45:01 +0000 |
| Subject: | com web/php: Goodbye Magic Quotes: include/langchooser.inc include/prepend.inc manual-lookup.php manual/add-note.php search.php submit-event.php | ||
| Groups: | php.webmaster | ||
| Request: | Send a blank email to php-webmaster+get-28223@lists.php.net to get a copy of this message | ||
Commit: cfc6b38ec88e64a2f027dfaaa2b5c5954cd1d448
Author: Sara Golemon <pollita@php.net> Wed, 10 Jul 2019 13:43:58 -0400
Parents: 464ff738bafbd7882c3e9b399531702e95f08023
Branches: master
Link: http://git.php.net/?p=web/php.git;a=commitdiff;h=cfc6b38ec88e64a2f027dfaaa2b5c5954cd1d448
Log:
Goodbye Magic Quotes
Changed paths:
M include/langchooser.inc
M include/prepend.inc
M manual-lookup.php
M manual/add-note.php
M search.php
M submit-event.php
Diff:
diff --git a/include/langchooser.inc b/include/langchooser.inc
index 4da2636..ead8597 100644
--- a/include/langchooser.inc
+++ b/include/langchooser.inc
@@ -172,10 +172,10 @@ function language_choose_code()
// Add a language to the possible languages' list
function language_add($langcode, &$langs)
{
- global $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES, $MQ;
+ global $LANGUAGES, $INACTIVE_ONLINE_LANGUAGES;
// Make language code lowercase, html encode special chars and remove slashes
- $langcode = strtolower(htmlspecialchars($MQ ? stripslashes($langcode) : $langcode));
+ $langcode = strtolower(htmlspecialchars($langcode));
// The Brazilian Portuguese code needs special attention
if ($langcode == 'pt_br') { $langcode = 'pt_BR'; }
diff --git a/include/prepend.inc b/include/prepend.inc
index ee86788...67616bd 100644
--- a/include/prepend.inc
+++ b/include/prepend.inc
@@ -66,12 +66,6 @@ unset($LAST_UPDATED);
// Load the My PHP.net settings before any includes
myphpnet_load();
-// TODO: Remove MQ dependencies from phpweb
-$MQ = get_magic_quotes_gpc();
-if (get_magic_quotes_runtime()) {
- @set_magic_quotes_runtime(0);
-}
-
// Site details (mirror site information)
include __DIR__ . '/site.inc';
diff --git a/manual-lookup.php b/manual-lookup.php
index 1048a1f..b515926 100644
--- a/manual-lookup.php
+++ b/manual-lookup.php
@@ -21,10 +21,6 @@ if(!empty($_GET['scope']) &&
is_string($_GET['scope'])) {
// Prepare data for search
if ($function) {
- if ($MQ) {
- $function = stripslashes($function);
- }
-
$function = strtolower($function);
// Try to find appropriate manual page
diff --git a/manual/add-note.php b/manual/add-note.php
index 8203c17..e42e449 100644
--- a/manual/add-note.php
+++ b/manual/add-note.php
@@ -93,13 +93,12 @@ if ($process) {
(isset($_SERVER['HTTP_VIA']) ? $_SERVER['HTTP_VIA'] :
'');
// Post the variables to the central user note script
- // ($MQ is defined in prepend.inc)
$result = posttohost(
"http://master.php.net/entry/user-note.php",
array(
- 'user' => ($MQ ? stripslashes($user) : $user),
- 'note' => ($MQ ? stripslashes($note) : $note),
- 'sect' => ($MQ ? stripslashes($_POST['sect']) :
$_POST['sect']),
+ 'user' => $user,
+ 'note' => $note,
+ 'sect' => $_POST['sect'],
'ip' => $_SERVER['REMOTE_ADDR'],
'redirip' => $redirip
)
@@ -145,7 +144,7 @@ if ($process) {
// Print out preview of note
echo '<p>This is what your entry will look like, roughly:</p>';
echo '<div id="usernotes">';
- manual_note_display(time(), ($MQ ? stripslashes($user) : $user), ($MQ ? stripslashes($note)
: $note), FALSE);
+ manual_note_display(time(), $user, $note, FALSE);
echo '</div><br><br>';
}
}
diff --git a/search.php b/search..php
index c2dee3b..6cb2304 100644
--- a/search.php
+++ b/search.php
@@ -8,13 +8,6 @@ $_FORM = &$_GET;
// ---------------------------------------------------------------------------
-// If PHP added some slashes to quotes, get rid of them
-if ($MQ) {
- foreach ($_FORM as $name => $value) {
- $_FORM[$name] = stripslashes($value);
- }
-}
-
// We received something to search for
if (!empty($_FORM['pattern'])) {
diff --git a/submit-event.php b/submit-event.php
index 5f4cef5..94b31e1 100644
--- a/submit-event.php
+++ b/submit-event.php
@@ -31,13 +31,6 @@ foreach($vars as $varname) {
// We need to process some form data
if ($process) {
- // Clean up magic quotes, if they were inserted
- if ($MQ) {
- foreach ($_POST as $k => $v) {
- $_POST[$k] = stripslashes($v);
- }
- }
-
// Clean and validate data
if (!is_emailable_address($_POST['email'])) {
$errors[] = 'You must supply a valid email address.';