3 ms·
It's serving me source code... public function build_time_query( $column, $compare, $hour = null, $minute = null, $second = null ) { global $wpdb;
by taspeotis 4y ago
It's serving me source code...
public function build_time_query( $column, $compare, $hour = null, $minute = null, $second = null ) {
global $wpdb;
// Have to have at least one.
if ( ! isset( $hour ) && ! isset( $minute ) && ! isset( $second ) ) {
return false;
}
What sort of failure mode causes a website to just dump the backend source? Oh it's PHP...
- seydor 4y agoActually it's ~~apache~~ Litespeed
- sgjohnson 4y agoIt has got nothing to do with PHP whatsoever...
- lionkor 4y agoIts PHP
- seydor 4y agoIt's everything BUT php. The mysql server on the site is too slow and crashed, the HTTP server somehow broke and served source code. PHP is the only thing that works there, and it tells you that mysql connection is not available.
- zarzavat 4y agoThe HTTP server is serving source code because of the braindead system of HTTP routing that PHP encouraged (because it's "easy") whereby scripts are stored in the root path amongst resources, and the file system is used for routing. In other languages the HTTP server doesn't even know where the source code is.
- sgjohnson 4y ago> scripts are stored in the root path amongst resources that has been a known and documented bad practice for _at least_ 10 years.
- seydor 4y agoFirst, thank you for hating PHP, i'd hate to see it ending up like javascript, especially when ppl misunderstand basic things like this. This 'braindead' system is how the web has been designed from the start. And that issue can easily be mitigated by having using an index.php that simply does require('../app/app.php'). Serving files as text really has nothing to do with PHP since PHP interpreter isnt even invoked at all.
- yashap 4y agoHuh? This particular bug has everything to do with PHP. PHP is reasonably unique in the model of “treat everything like a standard webserver serving up files from the filesystem, except they’re PHP scripts/templates that get evaluated to produce content, vs a true static file.” But misconfigure your web server, and it’ll just serve up the source code instead. This wouldn’t happen in almost any other language.
- ebiester 4y agoAnd as always, archive today (or an alternative) saves the day: https://archive.ph/hHiCJ https://archive.ph/hHiCJ