marcodeltongo / thematic

Automatically exported from code.google.com/p/thematic
0 stars 0 forks source link

PHP Notice: Undefined index: s in content-extensions.php #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I sometimes get undefined index from line 852 of 
/thematic/library/extensions/content-extensions.php

Changing line 852 from:-
<input id="error404-s" name="s" type="text" value="<?php echo 
esc_html(stripslashes($_GET['s'])) ?>" size     ="40" />

To:-
input id="error404-s" name="s" type="text" value="<?php echo 
esc_html(stripslashes(get_query_var('s')))      ?>" size="40" />

fixes the problem, as the get_query_var method checks that the index has been 
set.

Original issue reported on code.google.com by mark...@gmail.com on 7 Aug 2010 at 9:46

GoogleCodeExporter commented 9 years ago
Also, in the same file, line 556 generates a 'Trying to get property of 
non-object'.

To fix, change line 556 from:-
if ($post->post_type == 'page' || is_404()) {

to:-
if (is_404() || $post->post_type == 'page') {

I should have said previously:-
- both notices are generated when viewing the 404 not found page
- I am using Thematic 0.9.7.3

Original comment by mark...@gmail.com on 7 Aug 2010 at 10:13

GoogleCodeExporter commented 9 years ago
And one more in
/library/extensions/dynamic-classes.php line 312

This time a WP notification from using a deprecated parameter.

To fix:

Change line 312
$c[] = 'author-' . 
sanitize_title_with_dashes(strtolower(get_the_author('login')));

to:
$c[] = 'author-' . 
sanitize_title_with_dashes(strtolower(get_the_author_meta('user_login')));

Original comment by mark...@gmail.com on 8 Aug 2010 at 12:25

GoogleCodeExporter commented 9 years ago
The first two issues are fixed in r703

The third had been previously fixed in an earlier rev.

Update to the latest svn for a cleaner version with less deprecation.

Thanks for all the help :)

Original comment by eugene.m...@gmail.com on 8 Aug 2010 at 3:59

GoogleCodeExporter commented 9 years ago

Original comment by eugene.m...@gmail.com on 8 Aug 2010 at 3:59