TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

How to prevent a leak like Tumblr’s

10 点作者 KevBurnsJr大约 14 年前

6 条评论

nbpoole大约 14 年前
"The only solution I see to this is pre-commit syntax checking for committed PHP files."<p>How would that have helped here? The file was obviously still valid syntactically. Try it for yourself: create a PHP file that looks like<p><pre><code> i?php $config_data = array(); </code></pre> and run it through PHP's syntax check (<i>php -l /path/to/file</i> from the command line). It will verify that the script is valid. However, the content will still not be parsed as PHP.<p>One way to fix this is to store your configuration data in another file format (eg: YAML) outside of the document root. Since the configuration file doesn't try to be parsed as PHP, it can't be leaked in this way.
评论 #2343775 未加载
评论 #2343597 未加载
评论 #2343621 未加载
d0m大约 14 年前
I'm far from being a PHP expert, but wouldn't writing critical password/data in a file instead of directly in the source code, avoided that issue? I mean, we would have seen the code to read the file.. and not the pass?
评论 #2343762 未加载
评论 #2343654 未加载
orlandu63大约 14 年前
Does the person not use syntax highlighting? A missing &#60;?php tag would cause the PHP code to be highlighted as HTML code which would look very strange to anyone who has edited a PHP file with a syntax-highlighting-enabled editor.
tszming大约 14 年前
Static code analysis is nice to have, but at least they should have some form of automated testing.
getsat大约 14 年前
How about: test on your staging environment before deploying to production?
revorad大约 14 年前
use emacs, not vi :-P
评论 #2343644 未加载
评论 #2344406 未加载