Skip to content

u/filiped

In this archive from Dec 2010 to Aug 2023

4
posts
202
comments
3
media
956
score
1 saved before deletion

Top posts

Top comments

1 - PHP has several problems with language design, core implementations, etc (many of these are legacy-related). It's also easy to get started with, which leads to a community with a large percentage of newbies making silly mistakes.

2 - (a lot of) programmers are elitists, bandwagon-lovers, or just trying to fit in; PHP is an easy target for the things I mentioned in the first point.

113 points

This is called CSRF, Cross-Site Request Forgery.

There are a two simple things you do to prevent this scenario.

  • Respect the HTTP specification - know the difference between a GET and POST request.

  • Require a unique secret token to be sent along with every POST submission. This is done by generating a secret string as a hidden form field:

    <input type="hidden" value="<?= .. secret .. ?>">

This token is saved with the user's session - when the user submits the form, the token is sent along, and must match the one saved with the session.

For this specific scenario, you'll also want to request the old password before allowing the user to change it.

29 points

I shared this project for the first time in this very subreddit, some 2 years ago, while it was still called "damnit". Some 5 million packagist downloads later it's still going strong, in great part thanks to the help of one the project's early contributors, denis-sokolov, who I can't praise enough.

I've been working on a redesign of the error page for quite a while, and it's been recently released, along with some other goodies and bug fixes.

20 points

Subreddits

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.