Check-in [51269b3994]
Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
| Comment: | Log submit failures |
|---|---|
| Downloads: | Tarball | ZIP archive | SQL archive |
| Timelines: | family | ancestors | descendants | both | trunk |
| Files: | files | file ages | folders |
| SHA1: |
51269b3994eaa2b4b09b4b24224e1d54 |
| User & Date: | mario 2021-12-21 13:48:42 |
Context
|
2021-12-21
| ||
| 13:49 | Logging function for submit failures check-in: d7b8c7f2f3 user: mario tags: trunk | |
| 13:48 | Log submit failures check-in: 51269b3994 user: mario tags: trunk | |
| 13:48 | Transition to microformats2 check-in: c489e4d6f3 user: mario tags: trunk | |
Changes
Changes to page_submit.php.
| ︙ | ︙ | |||
66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
*
*/
if ($name and $_REQUEST->has("title", "description")) {
// Check field lengths
if (!$_REQUEST->multi->serialize->length…150…150->strlen["title,description,homepage,changes"]) {
print("<h3>Submission too short</h3> <p>You didn't fill out crucial information. Please note that our user base expects an enticing set of data points to find your project.</p>");
}
// Terms and conditions
elseif (array_sum($_REQUEST->array->int->range…0…1["req"]) < 2) {
print "<h3>Terms and Conditions</h3> <p>Please go back and assert that your open source project listing is reusable under the CC-BY-SA license.</p>";
}
// Simple CSRF check
elseif (!csrf(TRUE)) {
print "<h3>CSRF token invalid</h3> <p>This is likely a session timeout (1 hour), etc. Please retry or login again.</p>";
}
// Passed
else {
// Merge new data
$release = new release($data);
$release->update(
$_REQUEST,
array(
"flag" => 0, // User flags presumably become obsolete when project gets manually edited
"submitter_openid" => $_SESSION["openid"],
"via" => "form",
)
);
// A few blacklists
if (data_blacklisted($release)) {
print "<h2>Error #52</h2> <p>An unspecified issue with storing your data. Please drop a note if you're not a spambot!</p>";
}
// Update project
elseif ($release->store()) {
print "<h2>Submitted</h2> <p>Project and release information have been updated. Thanks for your care!</p>
<p>See the published entry on <a href=\"http://freshcode.club/projects/$name\">http://freshcode.club/projects/$name</a>.</p>";
}
| > > > | 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 |
*
*/
if ($name and $_REQUEST->has("title", "description")) {
// Check field lengths
if (!$_REQUEST->multi->serialize->length…150…150->strlen["title,description,homepage,changes"]) {
print("<h3>Submission too short</h3> <p>You didn't fill out crucial information. Please note that our user base expects an enticing set of data points to find your project.</p>");
log_spam($_REQUEST, "too short");
}
// Terms and conditions
elseif (array_sum($_REQUEST->array->int->range…0…1["req"]) < 2) {
print "<h3>Terms and Conditions</h3> <p>Please go back and assert that your open source project listing is reusable under the CC-BY-SA license.</p>";
}
// Simple CSRF check
elseif (!csrf(TRUE)) {
print "<h3>CSRF token invalid</h3> <p>This is likely a session timeout (1 hour), etc. Please retry or login again.</p>";
log_spam($_REQUEST, "csrf");
}
// Passed
else {
// Merge new data
$release = new release($data);
$release->update(
$_REQUEST,
array(
"flag" => 0, // User flags presumably become obsolete when project gets manually edited
"submitter_openid" => $_SESSION["openid"],
"via" => "form",
)
);
// A few blacklists
if (data_blacklisted($release)) {
print "<h2>Error #52</h2> <p>An unspecified issue with storing your data. Please drop a note if you're not a spambot!</p>";
log_spam($_REQUEST, "data_blacklisted");
}
// Update project
elseif ($release->store()) {
print "<h2>Submitted</h2> <p>Project and release information have been updated. Thanks for your care!</p>
<p>See the published entry on <a href=\"http://freshcode.club/projects/$name\">http://freshcode.club/projects/$name</a>.</p>";
}
|
| ︙ | ︙ |