1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-29 09:10:23 +02:00

Code optimization for speed and reduced memory usage.

This commit is contained in:
Cameron
2020-12-20 11:50:10 -08:00
parent 6b5cc07929
commit 601df26d51
91 changed files with 522 additions and 482 deletions

View File

@@ -1113,7 +1113,7 @@ class download_shortcodes extends e_shortcode
private function renderNewIcon()
{
if(strstr(IMAGE_NEW,'<i ') || strstr(IMAGE_NEW,'<span'))
if(strpos(IMAGE_NEW, '<i ') !== false || strpos(IMAGE_NEW, '<span') !== false)
{
return IMAGE_NEW;
}

View File

@@ -1299,7 +1299,7 @@ $columnInfo = array(
{
$fpath = str_replace(e_DOWNLOAD,"",$file_array[$counter]['path']).$file_array[$counter]['fname'];
$selected = '';
if (stristr($fpath, $download_url) !== FALSE)
if (stripos($fpath, $download_url) !== false)
{
$selected = " selected='selected'";
$found = 1;

View File

@@ -38,7 +38,7 @@ if (!is_numeric(e_QUERY) && empty($_GET['id']))
if(strstr(e_QUERY, "mirror"))
if(strpos(e_QUERY, "mirror") !== false)
{ // Download from mirror
list($action, $download_id, $mirror_id) = explode(".", e_QUERY);
$download_id = intval($download_id);
@@ -86,7 +86,7 @@ if(strstr(e_QUERY, "mirror"))
}
$tmp = explode(".", e_QUERY);
if (!$tmp[1] || strstr(e_QUERY, "pub_"))
if (!$tmp[1] || strpos(e_QUERY, "pub_") !== false)
{
$id = intval($tmp[0]);
$type = "file";
@@ -108,7 +108,7 @@ if(vartrue($_GET['id'])) // SEF URL
if (preg_match("#.*\.[a-z,A-Z]{3,4}#", e_QUERY))
{
if(strstr(e_QUERY, "pub_"))
if(strpos(e_QUERY, "pub_") !== false)
{
$bid = str_replace("pub_", "", e_QUERY);
if (file_exists(e_UPLOAD.$bid))
@@ -216,7 +216,7 @@ if ($type == "file")
// echo $binary_data;
// exit();
// }
if (strstr($row['download_url'], "http://") || strstr($row['download_url'], "ftp://") || strstr($row['download_url'], "https://"))
if (strpos($row['download_url'], "http://") !== false || strpos($row['download_url'], "ftp://") !== false || strpos($row['download_url'], "https://") !== false)
{
$download_url = e107::getParser()->parseTemplate($row['download_url'],true); // support for shortcode-driven dynamic URLS.
e107::redirect(decorate_download_location($download_url));