elyobo
Forum Replies Created
-
Forum: Plugins
In reply to: [Plugin: Plugin Dependencies] Script load order bugThanks ??
Forum: Plugins
In reply to: [Plugin: Plugin Dependencies] Script load order bugIndeed.
Forum: Themes and Templates
In reply to: How to prevent duplicate posts with wp_insert_post on single.phpSee this ticket #11081 on trac; it was marked invalid, but there is an explanation and a solution there.
In short, try wrapping your codde up like this to prevent your code firing during cron and ajax; wp_insert_post triggers cron, causing duplicate posts.
if ( true !== DOING_CRON && true !== DOING_AJAX ) { // Do your stuff }
Forum: Plugins
In reply to: [Plugin Dependencies] Plugin DependenciesOnly come across one issue so far, line 164 in plugin-dependencies.php doesn’t check that the array index exists before using it, throwing out a pile of notices for those that aren’t suppressing them. This then blocks the redirect header so we get a pile of notices on screen and nothing else.
Simple fix, either suppress errors or check first, e.g.
$deps = @self::$dependencies[ $dep ];
or
$deps = isset(self::$dependencies[ $dep ]) ? self::$dependencies[ $dep ] : array();
Forum: Plugins
In reply to: [Plugin Dependencies] Plugin DependenciesSounds great, are there docs for the headers somewhere? I take it that Provides: would implement the second feature, is there anything that implements the conflicting feature?
Looks like there are three more in the version I have.
$ egrep -n -B 1 “HTTPS.* == ‘Off” *
domain_mapping.php-689- if ( false == isset( $_SERVER[ ‘HTTPS’ ] ) )
domain_mapping.php:690: $_SERVER[ ‘HTTPS’ ] == ‘Off’;
—
domain_mapping.php-735- if ( false == isset( $_SERVER[ ‘HTTPS’ ] ) )
domain_mapping.php:736: $_SERVER[ ‘HTTPS’ ] == ‘Off’;
—
domain_mapping.php-781- if ( false == isset( $_SERVER[ ‘HTTPS’ ] ) )
domain_mapping.php:782: $_SERVER[ ‘HTTPS’ ] == ‘Off’;No probs, thanks for the quick application of the fix. The environment will have it set already if it’s using HTTPS, so no errors would be seen, but non HTTPS servers with the appropriate PHP error_reporting settings would see it. Aside from the warning, the behaviour was still correct anyway, as it treats the undefined index the same as off ??
It’s a simple error in the code; the author is using an == where there should be an =, which leads to a missing index in the request. I can’t upload a patch here, but if you change line 545 from
$_SERVER[ ‘HTTPS’ ] == ‘Off’;
to
$_SERVER[ ‘HTTPS’ ] = ‘Off’;
Then you’ll fix the error.