Skip to content

Commit 20cc594

Browse files
author
Joshua Parker
committed
Merge branch 'develop'
2 parents 507302d + 45a2658 commit 20cc594

File tree

840 files changed

+59453
-9343
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

840 files changed

+59453
-9343
lines changed

RELEASE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
6.3.3
1+
6.3.4

app/functions.php

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ function url($route)
1414

1515
/**
1616
* Renders any unwarranted special characters to HTML entities.
17-
*
17+
*
1818
* @since 1.0.0
1919
* @param string $str
2020
* @return mixed
@@ -97,7 +97,7 @@ function remoteFileExists($url)
9797

9898
/**
9999
* Return the file extension of the given filename.
100-
*
100+
*
101101
* @param string $filename
102102
* @return string
103103
* @since 1.0.0
@@ -137,11 +137,11 @@ function safe_truncate($string, $length, $append = '...')
137137

138138
/**
139139
* Special function for files including
140-
*
140+
*
141141
* @param string $file
142142
* @param bool $once
143143
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
144-
*
144+
*
145145
* @return bool
146146
* @since 1.0.0
147147
*/
@@ -164,11 +164,11 @@ function _require($file, $once = false, $show_errors = true)
164164

165165
/**
166166
* Special function for files including
167-
*
167+
*
168168
* @param string $file
169169
* @param bool $once
170170
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
171-
*
171+
*
172172
* @return bool
173173
* @since 1.0.0
174174
*/
@@ -191,10 +191,10 @@ function _include($file, $once = false, $show_errors = true)
191191

192192
/**
193193
* Special function for files including
194-
*
194+
*
195195
* @param string $file
196196
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
197-
*
197+
*
198198
* @return bool
199199
* @since 1.0.0
200200
*/
@@ -205,10 +205,10 @@ function _require_once($file, $show_errors = true)
205205

206206
/**
207207
* Special function for files including
208-
*
208+
*
209209
* @param string $file
210210
* @param bool|Closure $show_errors If bool error will be processed, if Closure - only Closure will be called
211-
*
211+
*
212212
* @return bool
213213
* @since 1.0.0
214214
*/
@@ -219,7 +219,7 @@ function _include_once($file, $show_errors = true)
219219

220220
/**
221221
* Validate email.
222-
*
222+
*
223223
* @param string $email
224224
* @return string (ok, empty, bad email).
225225
* @since 1.0.0
@@ -236,7 +236,7 @@ function validate_email($email)
236236

237237
/**
238238
* Formats date to be stored in MySQL database.
239-
*
239+
*
240240
* @return string
241241
* @since 1.0.0
242242
*/
@@ -250,7 +250,7 @@ function formatDate($date)
250250

251251
/**
252252
* Removes all whitespace.
253-
*
253+
*
254254
* @param string $str
255255
* @return mixed
256256
* @since 1.0.0
@@ -262,7 +262,7 @@ function _trim($str)
262262

263263
/**
264264
* Function used to create a slug associated to an "ugly" string.
265-
*
265+
*
266266
* @param string $string the string to transform.
267267
* @return string the resulting slug.
268268
* @since 1.0.0
@@ -307,7 +307,7 @@ function getFilesize($file, $digits = 2)
307307

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

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

34473447
/**
34483448
* Concatenation with separator.
3449-
*
3449+
*
34503450
* @since 1.0.8
34513451
* @param string $separator Delimeter to used between strings.
34523452
* @param type $string1 Left string.

app/functions/core-function.php

Lines changed: 31 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<?php
22
if (!defined('BASE_PATH'))
33
exit('No direct script access allowed');
4+
$app = \Liten\Liten::getInstance();
5+
46
/**
57
* eduTrac SIS Core Functions
68
*
@@ -10,10 +12,9 @@
1012
* @package eduTrac SIS
1113
* @author Joshua Parker <joshmac3@icloud.com>
1214
*/
13-
define('CURRENT_RELEASE', '6.3.0');
15+
const CURRENT_RELEASE = '6.3';
1416
define('RELEASE_TAG', trim(_file_get_contents(BASE_PATH . 'RELEASE')));
15-
16-
$app = \Liten\Liten::getInstance();
17+
define('REQUEST_TIME', $app->req->server['REQUEST_TIME']);
1718
use League\Event\Event;
1819
use PHPBenchmark\HtmlView;
1920
use PHPBenchmark\Monitor;
@@ -896,7 +897,7 @@ function get_layouts_header($layout_dir = '')
896897
function subdomain_as_directory()
897898
{
898899
$app = \Liten\Liten::getInstance();
899-
900+
900901
$subdomain = '';
901902
$domain_parts = explode('.', $app->req->server['SERVER_NAME']);
902903
if (count($domain_parts) == 3) {
@@ -1024,7 +1025,7 @@ function is_etsis_exception($object)
10241025
*/
10251026
function file_mod_time($file)
10261027
{
1027-
return filemtime($file);
1028+
filemtime($file);
10281029
}
10291030

10301031
/**
@@ -1922,3 +1923,28 @@ function etsis_between($val, $min, $max)
19221923
{
19231924
return ($val - $min) * ($val - $max) <= 0;
19241925
}
1926+
1927+
/**
1928+
* Checks if a variable is null. If not null, check if integer or string.
1929+
*
1930+
* @since 6.3.4
1931+
* @param string|int $var Variable to check.
1932+
* @return string|int|null Returns null if empty or a string or an integer.
1933+
*/
1934+
function if_null($var)
1935+
{
1936+
$_var = ctype_digit($var) ? (int) $var : (string) $var;
1937+
return $var === '' ? NULL : $_var;
1938+
}
1939+
1940+
/**
1941+
* If variable is not null, return it.
1942+
*
1943+
* @since 6.3.4
1944+
* @param string|int $var Variable to check.
1945+
* @return string|int|null Returns false if NULL or a string or an integer.
1946+
*/
1947+
function if_not_null($var)
1948+
{
1949+
return $var !== NULL ? _escape($var) : false;
1950+
}

app/functions/hook-function.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ function grading_scale($grade = NULL)
13181318
{
13191319
$app = \Liten\Liten::getInstance();
13201320
try {
1321-
$select = '<select name="grade[]" class="selectpicker form-control" data-style="btn-info" data-size="10" data-live-search="true" required>' . "\n";
1321+
$select = '<select name="grade[]" class="selectpicker form-control" data-style="btn-info" data-size="10" data-live-search="true">' . "\n";
13221322
$select .= '<option value="">&nbsp;</option>' . "\n";
13231323
$scale = $app->db->query('SELECT * FROM grade_scale WHERE status = "1"');
13241324
$q = $scale->find(function ($data) {

0 commit comments

Comments
 (0)