Skip to content

Commit 60c25aa

Browse files
committed
New PHP 8-compatible main branch
1 parent d0cac54 commit 60c25aa

File tree

16 files changed

+61
-61
lines changed

16 files changed

+61
-61
lines changed

entry/event.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ function day($in) {
6060

6161
if ($smonth == $emonth && $sday == $eday && $syear == $eyear)
6262
die("start and end dates are identical");
63-
63+
6464
$query = "INSERT INTO phpcal SET tipo=2,"
6565
. "sdato=?, edato=?, sdesc=?, url=?, email=?, ldesc=?, country=?, category=?";
6666
db_query_safe($query, [
@@ -85,7 +85,7 @@ function day($in) {
8585
die("invalid type");
8686
}
8787

88-
$new_id = mysql_insert_id();
88+
$new_id = mysql_insert_id();
8989

9090
$msg .= "Country: ".$country."\n"
9191
. "Category: ".$cat[$category]."\n"
@@ -94,6 +94,6 @@ function day($in) {
9494

9595
# add signature/actions
9696
$msg .= "\n-- \n"
97-
. "https://master.php.net/manage/event.php?id=$new_id&action=approve\n"
98-
. "https://master.php.net/manage/event.php?id=$new_id&action=reject\n"
99-
. "https://master.php.net/manage/event.php?id=$new_id\n";
97+
. "https://main.php.net/manage/event.php?id=$new_id&action=approve\n"
98+
. "https://main.php.net/manage/event.php?id=$new_id&action=reject\n"
99+
. "https://main.php.net/manage/event.php?id=$new_id\n";

entry/svn-account.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -91,9 +91,9 @@
9191
}
9292

9393
$msg .= "\n-- \n";
94-
$msg .= "approve: https://master.php.net/manage/users.php?action=approve&id=$new_id\n";
95-
$msg .= "reject: https://master.php.net/manage/users.php?action=remove&id=$new_id\n";
96-
$msg .= "view: https://master.php.net/manage/users.php?id=$new_id\n";
94+
$msg .= "approve: https://main.php.net/manage/users.php?action=approve&id=$new_id\n";
95+
$msg .= "reject: https://main.php.net/manage/users.php?action=remove&id=$new_id\n";
96+
$msg .= "view: https://main.php.net/manage/users.php?id=$new_id\n";
9797

9898
mail($failto,"VCS Account Request: $username",$msg,"From: $from\r\nMessage-ID: <cvs-account-$new_id-admin@php.net>", "-fnoreply@php.net");
9999
} else {

entry/user-note.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,18 +125,18 @@ function validateUser($user) {
125125
// $msg .= "\n----\n";
126126

127127
$msg .= "Manual Page -- http://php.net/manual/en/$sect.php\n";
128-
$msg .= "Edit -- https://master.php.net/note/edit/$new_id\n";
129-
//$msg .= "Approve -- https://master.php.net/manage/user-notes.php?action=approve+$new_id&report=yes\n";
128+
$msg .= "Edit -- https://main.php.net/note/edit/$new_id\n";
129+
//$msg .= "Approve -- https://main.php.net/manage/user-notes.php?action=approve+$new_id&report=yes\n";
130130
foreach ($note_del_reasons AS $reason) {
131131
$msg .= "Del: "
132132
. str_pad($reason, $note_del_reasons_pad)
133-
. "-- https://master.php.net/note/delete/$new_id/" . urlencode($reason) ."\n";
133+
. "-- https://main.php.net/note/delete/$new_id/" . urlencode($reason) ."\n";
134134
}
135135

136136
// @phan-suppress-next-line PhanParamSuspiciousOrder - weird global padding count, but ok
137-
$msg .= str_pad('Del: other reasons', $note_del_reasons_pad) . "-- https://master.php.net/note/delete/$new_id\n";
138-
$msg .= "Reject -- https://master.php.net/note/reject/$new_id\n";
139-
$msg .= "Search -- https://master.php.net/manage/user-notes.php\n";
137+
$msg .= str_pad('Del: other reasons', $note_del_reasons_pad) . "-- https://main.php.net/note/delete/$new_id\n";
138+
$msg .= "Reject -- https://main.php.net/note/reject/$new_id\n";
139+
$msg .= "Search -- https://main.php.net/manage/user-notes.php\n";
140140
# make sure we have a return address.
141141
if (!$user) $user = "php-general@lists.php.net";
142142
# strip spaces in email address, or will get a bad To: field

entry/user-notes-vote.php

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/*
33
This script acts as the backend communication API for the user notes vote feature.
44
Requests come in here from the php.net to update the database with new votes.
5-
master.php.net should respond with a JSON object (with one required property [status] and two optional properties
5+
main.php.net should respond with a JSON object (with one required property [status] and two optional properties
66
[votes] and [message]).
77
The JSON object [status] property contains a status returned by the server for that request.
88
It's value may be either a boolean true or false. If the status is true the php.net will know the vote went through successfully.
@@ -32,31 +32,31 @@ function vote_validate_request(PDO $dbh) {
3232
FILTER_FLAG_NO_PRIV_RANGE |
3333
FILTER_FLAG_IPV4))
3434
{
35-
$ip = sprintf("%u", ip2long($_POST['ip']));
35+
$ip = sprintf("%u", ip2long($_POST['ip']));
3636
} else {
3737
// If the IP can't be validated use a non routable IP for loose validation (i.e. IPv6 and clients that couldn't send back proper IPs)
38-
$ip = 0;
38+
$ip = 0;
3939
}
40-
40+
4141
if (isset($_SERVER['REMOTE_ADDR']) &&
4242
filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_RES_RANGE |
4343
FILTER_FLAG_NO_PRIV_RANGE |
4444
FILTER_FLAG_IPV4))
4545
{
46-
$hostip = sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
46+
$hostip = sprintf("%u", ip2long($_SERVER['REMOTE_ADDR']));
4747
} else {
4848
// If the IP can't be validated use a non routable IP for loose validation (i.e. IPv6 and clients that couldn't send back proper IPs)
4949
$hostip = 0;
5050

5151
}
52-
52+
5353
if (!empty($_POST['noteid']) && filter_var($_POST['noteid'], FILTER_VALIDATE_INT))
5454
{
5555
$id = filter_var($_POST['noteid'], FILTER_VALIDATE_INT);
5656
} else {
5757
return false;
5858
}
59-
59+
6060
if (!empty($_POST['vote']) && ($_POST['vote'] === 'up' || $_POST['vote'] === 'down'))
6161
{
6262
$vote = $_POST['vote'] === 'up' ? 1 : 0;
@@ -81,7 +81,7 @@ function vote_validate_request(PDO $dbh) {
8181
if ($noteResult['sect'] !== $_POST['sect']) {
8282
return false;
8383
}
84-
84+
8585
// Validate remote IP has not exceeded voting limits
8686
$remoteStmt = $dbh->prepare("SELECT COUNT(*) AS num FROM votes WHERE ip = :ip AND ts >= (NOW() - INTERVAL 1 DAY) AND note_id = :id");
8787
if (!$remoteStmt) {
@@ -96,7 +96,7 @@ function vote_validate_request(PDO $dbh) {
9696
if ($remoteResult['num'] >= 1) { // Limit of 1 vote, per note, per remote IP, per day.
9797
return false;
9898
}
99-
99+
100100
// Validate host IP has not exceeded voting limits
101101
$hostStmt = $dbh->prepare("SELECT COUNT(*) AS num FROM votes WHERE hostip = :ip AND ts >= (NOW() - INTERVAL 1 HOUR) AND note_id = :id");
102102
if (!$hostStmt) {

fetch/cvsauth.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
1919
$ctx = stream_context_create(["http" => $opts]);
2020
21-
$s = file_get_contents("https://master.php.net/fetch/cvsauth.php", false, $ctx);
21+
$s = file_get_contents("https://main.php.net/fetch/cvsauth.php", false, $ctx);
2222
2323
$a = @unserialize($s);
2424
if (!is_array($a)) {

fetch/user-notes-rss.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,13 @@
4141
>
4242
<channel rdf:about="http://php.net/">
4343
<title>PHP Manual User Notes</title>
44-
<link>https://master.php.net/manage/user-notes.php</link>
44+
<link>https://main.php.net/manage/user-notes.php</link>
4545
<description/>
4646
<items>
4747
<?php if ($notes) { ?>
4848
<rdf:Seq>
49-
<rdf:li rdf:resource="https://master.php.net/note/edit/<?php
50-
echo implode('"/> <rdf:li rdf:resource="https://master.php.net/note/edit/',
49+
<rdf:li rdf:resource="https://main.php.net/note/edit/<?php
50+
echo implode('"/> <rdf:li rdf:resource="https://main.php.net/note/edit/',
5151
array_keys($notes));?>"/>
5252
</rdf:Seq>
5353
<?php } ?>
@@ -56,15 +56,15 @@
5656
<image rdf:about="http://php.net/images/php.gif">
5757
<title>PHP Manual User Notes</title>
5858
<url>http://php.net/images/php.gif</url>
59-
<link>https://master.php.net/manage/user-notes.php</link>
59+
<link>https://main.php.net/manage/user-notes.php</link>
6060
</image>
6161
<?php
6262
foreach ($notes as $note) {
6363
?>
6464
<item>
6565
<title><?php echo htmlspecialchars(substr($note['note'], 0, 40));
6666
echo strlen($note['note']) < 40 ? '...' : ''; ?></title>
67-
<link>https://master.php.net/note/edit/<?php echo $note['id']; ?></link>
67+
<link>https://main.php.net/note/edit/<?php echo $note['id']; ?></link>
6868
<description>
6969
<![CDATA[
7070
<?php echo htmlspecialchars($note['note']); ?>

forgot.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,10 @@ function username_from_forgotten($key, $id) {
8181
To change your password, simply use the URL below and choose a new
8282
password.
8383
84-
https://master.php.net/forgot.php?id=$row[userid]&key=$newpass
84+
https://main.php.net/forgot.php?id=$row[userid]&key=$newpass
8585
8686
Let us know if you have any further problems.
87-
--
87+
--
8888
group@php.net
8989
";
9090
mailer($row['username'] . '@php.net',"Password change instructions for $row[username]",$body,'group@php.net', 'PHP Group');

include/email-templates.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ function mt_approve_user($userinfo, $mailtext) {
66
"Your VCS account ($userinfo[username]) was created.
77
88
If you ever forget your password, you can reset it at:
9-
https://master.php.net/forgot.php
9+
https://main.php.net/forgot.php
1010
1111
To change your password, or other information about you please login on:
12-
https://master.php.net/manage/users.php?username=$userinfo[username]
12+
https://main.php.net/manage/users.php?username=$userinfo[username]
1313
1414
Your profile page will be created shortly and can be found at:
1515
https://people.php.net/$userinfo[username]
@@ -19,7 +19,7 @@ be active within the next 24 hours.
1919
2020
2121
Please note: Before you can push to our repositories, please add your
22-
SSH Key on master (using the URL above).
22+
SSH Key on main (using the URL above).
2323
2424
All our git repositories are listed at:
2525
https://github.com/php/

include/functions.inc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@ function head($title="", $config = []) {
2727
$dconfig = ["columns" => 1];
2828

2929
$config = array_merge($dconfig, $config);
30-
$SUBDOMAIN = "master";
31-
$TITLE = $title ?: "master";
30+
$SUBDOMAIN = "main";
31+
$TITLE = $title ?: "main";
3232
$LINKS = [
3333
["href" => "/manage/event.php", "text" => "Events"],
3434
["href" => "/manage/users.php", "text" => "Users"],
@@ -91,7 +91,7 @@ function warn($message) { echo format_warn($message); }
9191

9292
function db_connect($dieonerror = TRUE)
9393
{
94-
if (!mysql_connect("localhost", "nobody", "")) {
94+
if (!@mysql_connect("localhost", "nobody", "")) {
9595
if ($dieonerror) {
9696
die(format_warn("Unable to connect to database!"));
9797
}

include/login.inc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
if (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] != "on") {
55
$name = basename($_SERVER["SCRIPT_NAME"]);
66
if ($name === 'login.php') {
7-
header("Location: https://master.php.net/" . $name);
7+
header("Location: https://main.php.net/" . $name);
88
} else {
9-
header("Location: https://master.php.net/manage/" . $name);
9+
header("Location: https://main.php.net/manage/" . $name);
1010
}
1111
exit;
1212
}

0 commit comments

Comments
 (0)