Skip to content
This repository has been archived by the owner on Sep 16, 2019. It is now read-only.

comments.php error #297

Closed
badcat opened this issue Apr 8, 2015 · 6 comments
Closed

comments.php error #297

badcat opened this issue Apr 8, 2015 · 6 comments

Comments

@badcat
Copy link

badcat commented Apr 8, 2015

I'm getting this error:

Fatal error: Can't use function return value in write context in .../comments.php on line 39

any ideas?

@t-fulton
Copy link

t-fulton commented Apr 9, 2015

Also getting this error with a fresh install, looking at 7acc16c and reverting line 39 code back to what it was resolves the issue. Hoping olefredrik has a chance to take a look at this.

@badcat
Copy link
Author

badcat commented Apr 9, 2015

Same here - I also tried this with Josh's fork https://github.com/josh-rathke/FoundationPress
For now, I've commented out lines 39 and 40.

I wanted to try to use FP as a parent theme, but it looks like it's really better to approach this like using UnderscoreS - and just start adding / removing what I need directly, instead of building a Child theme.

@theodorocaliari
Copy link

Same here...

Fatal error: Can't use function return value in write context in C:\EasyPHP14\data\localweb\projects\w4\wp-content\themes\foundationpress\comments.php on line 39

Like @t-fulton says, I change the line and works... Fallback to:

if (!empty($_SERVER['SCRIPT_FILENAME']) && 'comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die (__('Please do not load this page directly. Thanks!', 'FoundationPress'));

@Luciaisacomputer
Copy link
Contributor

Assigning to a variable and then checking if the variable is empty seems to work.

$file_name_to_check = sanitize_file_name( $_SERVER['SCRIPT_FILENAME'] );
if ( ! empty( $file_name_to_check) && 'comments.php' == basename( sanitize_file_name( $_SERVER['SCRIPT_FILENAME'] ) ) ) {
        die (__( 'Please do not load this page directly. Thanks!', 'FoundationPress' )); }

@chrisleach
Copy link

That helped me @LukePettway, thanks.

@olefredrik
Copy link
Owner

Fixed #309 . Shoutout to @josh-rathke for saving the day!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants