dehnavi / get-simple-cms

Automatically exported from code.google.com/p/get-simple-cms
GNU General Public License v3.0
0 stars 0 forks source link

Fix $kill notices on install.php #349

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently install.php is comparing $kill to an empty string. But $kill is never 
an empty string, it either exists (set to an error message) or it does not 
exist (is not set at all).

It is better to use isset().

I don’t have SVN installed as I have just bought a new laptop, but attached 
is a diff file. If someone could run it on install.php and update the trunk 
this issue can be closed.

Original issue reported on code.google.com by martijn.personal@gmail.com on 1 Sep 2012 at 7:35

Attachments:

GoogleCodeExporter commented 9 years ago
Whats the reproduction steps ?
When is this kill called ?
Just curious.

Ill try to get this commited for you.

Original comment by tablatronics on 4 Sep 2012 at 1:09

GoogleCodeExporter commented 9 years ago
1. Put a fresh copy of GetSimple in a folder.
2. Edit the temp.gsconfig.php to set GSDEBUG to TRUE and save as gsconfig.php
3. Run the installation.

You will see several notices displayed about the $kill variable not being 
declared. (There are also some notices about $SITENAME and other global 
variables from common.php, but I didn’t have the time to check those out.)

$kill is created on [line 48] or [line 59], inside an IF. This means the 
variable is not always declared at all. But later down in the file we compare 
it to an empty string as if the variable is always declared.

My changes (see diff file) check if the variable exists instead of comparing it 
to an empty string.

[line 48:] 
https://code.google.com/p/get-simple-cms/source/browse/trunk/admin/install.php#4
8
[line 59:] 
https://code.google.com/p/get-simple-cms/source/browse/trunk/admin/install.php#5
9

Original comment by martijn.personal@gmail.com on 5 Sep 2012 at 11:45

GoogleCodeExporter commented 9 years ago
So this is like a stop install flag ?

Original comment by tablatronics on 7 Sep 2012 at 5:28

GoogleCodeExporter commented 9 years ago
> So this is like a stop install flag ?

Looks like it. I didn’t implement it, I am just fixing a Notice that PHP 
throws about it. It seems to be a flag for a CHMOD error. And if the script 
can’t use CHMOD the way it wants it will not allow you to finish the 
installation.

Original comment by martijn.personal@gmail.com on 7 Sep 2012 at 8:38

GoogleCodeExporter commented 9 years ago
fixed

Original comment by MichaelS...@gmail.com on 10 Sep 2012 at 10:20