Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Parker committed Oct 12, 2017
2 parents 507302d + 45a2658 commit 20cc594
Show file tree
Hide file tree
Showing 840 changed files with 59,453 additions and 9,343 deletions.
2 changes: 1 addition & 1 deletion RELEASE
Original file line number Diff line number Diff line change
@@ -1 +1 @@
6.3.3
6.3.4
36 changes: 18 additions & 18 deletions app/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function url($route)

/**
* Renders any unwarranted special characters to HTML entities.
*
*
* @since 1.0.0
* @param string $str
* @return mixed
Expand Down Expand Up @@ -97,7 +97,7 @@ function remoteFileExists($url)

/**
* Return the file extension of the given filename.
*
*
* @param string $filename
* @return string
* @since 1.0.0
Expand Down Expand Up @@ -137,11 +137,11 @@ function safe_truncate($string, $length, $append = '...')

/**
* Special function for files including
*
*
* @param string $file
* @param bool $once
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
*
*
* @return bool
* @since 1.0.0
*/
Expand All @@ -164,11 +164,11 @@ function _require($file, $once = false, $show_errors = true)

/**
* Special function for files including
*
*
* @param string $file
* @param bool $once
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
*
*
* @return bool
* @since 1.0.0
*/
Expand All @@ -191,10 +191,10 @@ function _include($file, $once = false, $show_errors = true)

/**
* Special function for files including
*
*
* @param string $file
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
*
*
* @return bool
* @since 1.0.0
*/
Expand All @@ -205,10 +205,10 @@ function _require_once($file, $show_errors = true)

/**
* Special function for files including
*
*
* @param string $file
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
*
*
* @return bool
* @since 1.0.0
*/
Expand All @@ -219,7 +219,7 @@ function _include_once($file, $show_errors = true)

/**
* Validate email.
*
*
* @param string $email
* @return string (ok, empty, bad email).
* @since 1.0.0
Expand All @@ -236,7 +236,7 @@ function validate_email($email)

/**
* Formats date to be stored in MySQL database.
*
*
* @return string
* @since 1.0.0
*/
Expand All @@ -250,7 +250,7 @@ function formatDate($date)

/**
* Removes all whitespace.
*
*
* @param string $str
* @return mixed
* @since 1.0.0
Expand All @@ -262,7 +262,7 @@ function _trim($str)

/**
* Function used to create a slug associated to an "ugly" string.
*
*
* @param string $string the string to transform.
* @return string the resulting slug.
* @since 1.0.0
Expand Down Expand Up @@ -307,7 +307,7 @@ function getFilesize($file, $digits = 2)

/**
* Redirects to another page.
*
*
* @param string $location The path to redirect to
* @param int $status Status code to use
* @return bool False if $location is not set
Expand All @@ -323,10 +323,10 @@ function redirect($location, $status = 302)

/**
* Timing attack safe string comparison
*
*
* Compares two strings using the same time whether they're equal or not.
* This function should be used to mitigate timing attacks; for instance, when testing crypt() password hashes.
*
*
* @param string $known_string The string of known length to compare against
* @param string $user_string The user-supplied string
* @return boolean Returns TRUE when the two strings are equal, FALSE otherwise.
Expand Down Expand Up @@ -3446,7 +3446,7 @@ function kses_hook($t, &$C, &$S)

/**
* Concatenation with separator.
*
*
* @since 1.0.8
* @param string $separator Delimeter to used between strings.
* @param type $string1 Left string.
Expand Down
36 changes: 31 additions & 5 deletions app/functions/core-function.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<?php
if (!defined('BASE_PATH'))
exit('No direct script access allowed');
$app = \Liten\Liten::getInstance();

/**
* eduTrac SIS Core Functions
*
Expand All @@ -10,10 +12,9 @@
* @package eduTrac SIS
* @author Joshua Parker <[email protected]>
*/
define('CURRENT_RELEASE', '6.3.0');
const CURRENT_RELEASE = '6.3';
define('RELEASE_TAG', trim(_file_get_contents(BASE_PATH . 'RELEASE')));

$app = \Liten\Liten::getInstance();
define('REQUEST_TIME', $app->req->server['REQUEST_TIME']);
use League\Event\Event;
use PHPBenchmark\HtmlView;
use PHPBenchmark\Monitor;
Expand Down Expand Up @@ -896,7 +897,7 @@ function get_layouts_header($layout_dir = '')
function subdomain_as_directory()
{
$app = \Liten\Liten::getInstance();

$subdomain = '';
$domain_parts = explode('.', $app->req->server['SERVER_NAME']);
if (count($domain_parts) == 3) {
Expand Down Expand Up @@ -1024,7 +1025,7 @@ function is_etsis_exception($object)
*/
function file_mod_time($file)
{
return filemtime($file);
filemtime($file);
}

/**
Expand Down Expand Up @@ -1922,3 +1923,28 @@ function etsis_between($val, $min, $max)
{
return ($val - $min) * ($val - $max) <= 0;
}

/**
* Checks if a variable is null. If not null, check if integer or string.
*
* @since 6.3.4
* @param string|int $var Variable to check.
* @return string|int|null Returns null if empty or a string or an integer.
*/
function if_null($var)
{
$_var = ctype_digit($var) ? (int) $var : (string) $var;
return $var === '' ? NULL : $_var;
}

/**
* If variable is not null, return it.
*
* @since 6.3.4
* @param string|int $var Variable to check.
* @return string|int|null Returns false if NULL or a string or an integer.
*/
function if_not_null($var)
{
return $var !== NULL ? _escape($var) : false;
}
2 changes: 1 addition & 1 deletion app/functions/hook-function.php
Original file line number Diff line number Diff line change
Expand Up @@ -1318,7 +1318,7 @@ function grading_scale($grade = NULL)
{
$app = \Liten\Liten::getInstance();
try {
$select = '<select name="grade[]" class="selectpicker form-control" data-style="btn-info" data-size="10" data-live-search="true" required>' . "\n";
$select = '<select name="grade[]" class="selectpicker form-control" data-style="btn-info" data-size="10" data-live-search="true">' . "\n";
$select .= '<option value="">&nbsp;</option>' . "\n";
$scale = $app->db->query('SELECT * FROM grade_scale WHERE status = "1"');
$q = $scale->find(function ($data) {
Expand Down
Loading

0 comments on commit 20cc594

Please sign in to comment.