Remove obsolete $_SERVER['MAHARA_LIBDIR'] option

Bug #1465882 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Unassigned
15.10
Fix Released
Undecided
Unassigned

Bug Description

One of the oldest lines of code in the current Mahara codebase, is an undocumented feature in init.php. It checks for $_SERVER['MAHARA_LIBDIR'], and if this is present, it uses this location for $CFG->libdir instead of the default location $CFG->docroot/lib.

The $_SERVER superglobal is populated by the SAPI that's running PHP. If you're using mod_php, you can set it using the Apache directive "SetEnv MAHARA_LIBDIR /path/to/libdir". If you're executing PHP from the command-line, you can set it by exporting an environment fariable, i.e. "MAHARA_LIBDIR=/path/to/libdir; export MAHARA_LIBDIR; php htdocs/lib/cron.php"

There's really no reason to have this code in place. There is no supported Mahara hosting use-case where you would need the lib directory to be in a non-standard location. And as such, all this does is provide a potential vector for errors and attacks. So, I'm going to remove it.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/4857

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/4857
Committed: https://git.nzoss.org.nz/mahara/mahara/commit/647b87508480747663eb6a85f6f4228849546785
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 647b87508480747663eb6a85f6f4228849546785
Author: Aaron Wells <email address hidden>
Date: Wed Jun 17 11:34:43 2015 +1200

Remove obsolete $_SERVER['MAHARA_LIBDIR'] option (Bug 1465882)

Change-Id: Iae1f93c0129c1396aca633756b271fb41360836f

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Robert Lyon (robertl-9)
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.