2010-12-30, 23:59:33
Oleg06 Wrote:appears after clicking Create New ArticleWhile creating a new article the code is trying to read the saved version that doesn't yet exist. Adding a check for the object and fields not being empty eliminates the warnings...
Code:Notice: Trying to get property of non-object in /home/cp068800/public_html/neowebtime.ru/00/plugins/news.php on line 111
Notice: Trying to get property of non-object in /home/cp068800/public_html/neowebtime.ru/00/plugins/news.php on line 112
Code:
diff ~/public_html/GetSimple/plugins/n
ews.php.orig ~/public_html/GetSimple/plugins/news.php
109,112c109,116
< $file = GSDATANEWSPATH . $id . '.xml';
< $data = @getXML($file);
< $title = stripslashes($data->title);
< $content = stripslashes($data->content);
---
> $file = GSDATANEWSPATH . $id . '.xml';
> $data = @getXML($file);
> $title = '';
> if (!empty($data) && !empty($data->title))
> $title = stripslashes($data->title);
> $content = '';
> if (!empty($data) && !empty($data->content))
> $content = stripslashes($data->content);