Merged stuff

pull/17/head
Frode Petterson 2016-03-21 11:56:56 +01:00
parent 007137c257
commit 62e2f41884
1 changed files with 0 additions and 20 deletions

View File

@ -2415,15 +2415,8 @@ class H5PCore {
$type = $this->h5pF->getOption('site_type', 'local'); $type = $this->h5pF->getOption('site_type', 'local');
// Determine remote/visitor origin // Determine remote/visitor origin
<<<<<<< HEAD
if ($type === 'network' || if ($type === 'network' ||
($type === 'local' && !preg_match('/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/i', $_SERVER['REMOTE_ADDR']))) { ($type === 'local' && !preg_match('/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/i', $_SERVER['REMOTE_ADDR']))) {
=======
$localhostPattern = '/^localhost$|^127(?:\.[0-9]+){0,2}\.[0-9]+$|^(?:0*\:)*?:?0*1$/i';
// localhost
if ($type !== 'internet' && !preg_match($localhostPattern, $_SERVER['REMOTE_ADDR'])) {
>>>>>>> 14605dc7900f71801720972608b3a3d431ffedce
if (filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)) { if (filter_var($_SERVER['REMOTE_ADDR'], FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE)) {
// Internet // Internet
$this->h5pF->setOption('site_type', 'internet'); $this->h5pF->setOption('site_type', 'internet');
@ -2443,22 +2436,12 @@ class H5PCore {
* A distinct array of installed libraries * A distinct array of installed libraries
*/ */
public function getLibrariesInstalled() { public function getLibrariesInstalled() {
<<<<<<< HEAD
$librariesInstalled = array(); $librariesInstalled = array();
$libs = $this->h5pF->loadLibraries(); $libs = $this->h5pF->loadLibraries();
foreach($libs as $library) {
foreach($library as $libVersion) {
$librariesInstalled[$libVersion->name.' '.$libVersion->major_version.'.'.$libVersion->minor_version] = $libVersion->patch_version;
=======
$librariesInstalled = [];
$libs = $this->h5pF->loadLibraries();
foreach($libs as $libName => $library) { foreach($libs as $libName => $library) {
foreach($library as $libVersion) { foreach($library as $libVersion) {
$librariesInstalled[] = $libName.' '.$libVersion->major_version.'.'.$libVersion->minor_version.'.'.$libVersion->patch_version; $librariesInstalled[] = $libName.' '.$libVersion->major_version.'.'.$libVersion->minor_version.'.'.$libVersion->patch_version;
>>>>>>> 14605dc7900f71801720972608b3a3d431ffedce
} }
} }
@ -2466,7 +2449,6 @@ class H5PCore {
} }
/** /**
<<<<<<< HEAD
* Easy way to combine smiliar data sets. * Easy way to combine smiliar data sets.
* *
* @param array $inputs Multiple arrays with data * @param array $inputs Multiple arrays with data
@ -2483,8 +2465,6 @@ class H5PCore {
} }
/** /**
=======
>>>>>>> 14605dc7900f71801720972608b3a3d431ffedce
* Fetch a list of libraries' metadata from h5p.org. * Fetch a list of libraries' metadata from h5p.org.
* Save URL tutorial to database. Each platform implementation * Save URL tutorial to database. Each platform implementation
* is responsible for invoking this, eg using cron * is responsible for invoking this, eg using cron