e107_handlers/e_parse_class.php
File e_parse_class.php
has 3508 lines of code (exceeds 2000 allowed). Consider refactoring. Open
Open
<?php
/*
* e107 website system
*
* Copyright (C) 2008-2016 e107 Inc (e107.org)
Avoid deeply nested control flow statements. Open
Open
if (strpos($lbrks, $sp[$i - 1]) !== false)
{
break;
}
Avoid deeply nested control flow statements. Open
Open
if (strpos($lbrks, $matches[1][$i]) !== false)
{
break;
}
Consider simplifying this complex logical expression. Open
Open
if (strpos($file, 'http') === 0)
{
$path = $file;
}
elseif (strpos($file, 'e_MEDIA') !== false || strpos($file, 'e_THEME') !== false || strpos($file, 'e_PLUGIN') !== false || strpos($file, '{e_IMAGE}') !== false) //v2.x path.
Avoid too many return
statements within this method. Open
Open
return false;
Avoid too many return
statements within this method. Open
Open
return '<div class="' . $defClass . ' ' . vartrue($parm['class']) . '">' . $video . '</div>';
Avoid too many return
statements within this method. Open
Open
return "<img class='img-responsive img-fluid' src='" . $thumbSrc . "' alt='" . LAN_YOUTUBE_PLAYLIST . "' style='width:" . vartrue($parm['w'], '80') . "px'/>";
Avoid too many return
statements within this method. Open
Open
return $thumb;
Avoid too many return
statements within this method. Open
Open
return '
<div class="video-responsive">
<video width="' . $width . '" height="' . $height . '" controls>
<source src="' . $file . '" type="' . $mime . '">
Avoid too many return
statements within this method. Open
Open
return '<div class="' . $defClass . ' video-thumbnail thumbnail">' . $video . '</div>';
Avoid too many return
statements within this method. Open
Open
return e_IMAGE_ABS . 'generic/playlist_120.png';
Avoid too many return
statements within this method. Open
Open
return '<div class="' . $defClass . ' ' . vartrue($parm['class']) . '">' . $video . '</div>';
Avoid too many return
statements within this method. Open
Open
return $file;
Avoid too many return
statements within this method. Open
Open
return $text;
Assigning false
to property but \e_parse->multibyte
is int
Open
Open
private $multibyte = false; // previously $utfAction
- Exclude checks
Returning type string[]
but htmlwrap()
is declared to return string
Open
Open
return $str;
- Exclude checks
Argument 2 (subject)
is string[]
but \preg_split()
takes string
Open
Open
$content = preg_split('#(<.*?' . '>)#mis', $str, -1, PREG_SPLIT_NO_EMPTY | PREG_SPLIT_DELIM_CAPTURE);
- Exclude checks
Argument 2 (options)
is string
but \e_parse::thumbCacheFile()
takes array
defined at /code/e107_handlers/e_parse_class.php:2299
Open
Open
$staticFile = $this->thumbCacheFile($url, $opts);
- Exclude checks
Argument 2 (options)
is string
but \e_parse::thumbUrl()
takes array
defined at /code/e107_handlers/e_parse_class.php:2531
Open
Open
$url = $tp->thumbUrl($file, 'w=' . $width . '&h=' . $height . '&crop=' . $crop, false, $full);
- Exclude checks
Returning type null
but toImage()
is declared to return string
Open
Open
return null;
- Exclude checks
Invalid offset "class"
of array type array{}
Open
Open
return '<div class="' . $defClass . ' ' . vartrue($parm['class']) . '">' . $video . '</div>';
- Exclude checks
Returning type null
but toDate()
is declared to return string
Open
Open
return null;
- Exclude checks
Argument 2 (needle)
is int
but \mb_strrpos()
takes string
Open
Open
return mb_strrpos($haystack, $needle, $offset);
- Exclude checks
Call to deprecated function \e_parse::text_truncate()
defined at /code/e107_handlers/e_parse_class.php:1286
Open
Open
return $this->text_truncate($text, $length, $ending);
- Exclude checks
null
passed to foreach instead of array Open
Open
foreach ($this->allowedAttributes['default'] as $def)
- Exclude checks
Argument 1 (options)
is null
but \debug_backtrace()
takes bool|int
Open
Open
$log->addDebug('Broken Icon Path: ' . $icon . "\n" . print_r(debug_backtrace(null, 2), true), false)->save('IMALAN_00');
- Exclude checks
Argument 6 (postID)
is string
but \e_parse::processModifiers()
takes int
defined at /code/e107_handlers/e_parse_class.php:5611
Open
Open
$sub_blk = $this->processModifiers($opts, $sub_blk, $convertNL, $parseBB, $modifiers, $postID);
- Exclude checks
Invalid offset "mime"
of array type array{}
Open
Open
$mime = varset($parm['mime'], 'audio/mpeg');
- Exclude checks
Argument 1 (text)
is ?array|?string
but \e_parse_shortcode::parseCodes()
takes string
defined at /code/e107_handlers/shortcode_handler.php:817
Open
Open
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
- Exclude checks
Argument 3 (subject)
is ?array|?string|?string[]|?true
but \preg_replace()
takes array|string
Open
Open
$text = preg_replace('#<[^>]+>#', '<|>', $text);
- Exclude checks
Invalid offset "class"
of array type array{}
Open
Open
return '<div class="' . $defClass . ' ' . vartrue($parm['class']) . '">' . $video . '</div>';
- Exclude checks
Argument 1 (text)
is ?array|?string|?string[]
but \e_parse_shortcode::parseCodes()
takes string
defined at /code/e107_handlers/shortcode_handler.php:817
Open
Open
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
- Exclude checks
Call to deprecated function \e_parse::html_truncate()
defined at /code/e107_handlers/e_parse_class.php:1183
Open
Open
return $this->html_truncate($text, $length, $ending);
- Exclude checks
Reference to undeclared constant \e_HTTP_STATIC
Open
Open
$this->staticUrl = e_HTTP_STATIC;
- Exclude checks
Invalid offset "h"
of array type array{}
Open
Open
$height = varset($parm['h'], 240);
- Exclude checks
Invalid offset "mode"
of array type array{}
Open
Open
$mode = varset($parm['mode'], false); // tag, url
- Exclude checks
Invalid offset "mime"
of array type array{}
Open
Open
$mime = varset($parm['mime'], 'video/mp4');
- Exclude checks
Argument 2 (needle)
is int
but \mb_strpos()
takes string
Open
Open
return mb_strpos($haystack, $needle, $offset);
- Exclude checks
Argument 1 (haystack)
is false
but \strpos()
takes string
Open
Open
if (($this->isHtml($data)) && strpos($mod, 'no_html') === false)
- Exclude checks
Returning type null
but thumbDimensions()
is declared to return string
Open
Open
return null;
- Exclude checks
Default value for bool
$posted
can't be string
Open
Open
public function toEmail($text, $posted = '', $mods = 'parse_sc, no_make_clickable')
- Exclude checks
Argument 2 (options)
is string
but \e_parse::thumbUrl()
takes array
defined at /code/e107_handlers/e_parse_class.php:2531
Open
Open
$genericImg = $tp->thumbUrl($genericFile, 'w=' . $width . '&h=' . $height, true, $full);
- Exclude checks
Argument 2 (options)
is string
but \e_parse::thumbUrl()
takes array
defined at /code/e107_handlers/e_parse_class.php:2531
Open
Open
$url = $tp->thumbUrl($file, 'w=' . $width . '&h=' . $height . '&crop=' . $crop, false, $full);
- Exclude checks
Argument 2 (needle)
is ' '
but \e_parse::ustrrpos()
takes int
defined at /code/e107_handlers/e_parse_class.php:436
Open
Open
$spacepos = $this->ustrrpos($truncate, ' ');
- Exclude checks
Invalid offset "thumb"
of array type array{}
Open
Open
$thumb = vartrue($parm['thumb']);
- Exclude checks
Suspicious array access to ?float|?int|?mixed|?string
Open
Open
'field' => $parm['field']
- Exclude checks
Argument 1 (text)
is array
but \e_parse_shortcode::parseCodes()
takes string
defined at /code/e107_handlers/shortcode_handler.php:817
Open
Open
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
- Exclude checks
Argument 3 (subject)
is ?array|?string|?string[]|?true
but \str_replace()
takes array|string
Open
Open
$text = str_replace("\n\n\n", "\n\n", $text);
- Exclude checks
Invalid offset "default"
of array type array{}
Open
Open
foreach ($this->allowedAttributes['default'] as $def)
- Exclude checks
Suspicious type \Returns
of a variable or expression used to build a string. (Expected type to be able to cast to a string) Open
Open
$html = '<html><body>' . $html . '</body></html>';
- Exclude checks
Invalid offset "w"
of array type array{}
Open
Open
return "<img class='img-responsive img-fluid' src='" . $thumbSrc . "' alt='" . LAN_YOUTUBE_PLAYLIST . "' style='width:" . vartrue($parm['w'], '80') . "px'/>";
- Exclude checks
Returning type null
but setMultibyte()
is declared to return void
Open
Open
return null;
- Exclude checks
Suspicious array access to ?float|?int|?mixed|?string
Open
Open
'type' => $parm['type'],
- Exclude checks
Saw possibly unextractable annotation for a fragment of comment '* @param string':
after string,
did not see an element name (will guess based on comment order) Open
Open
* @param string
- Exclude checks
When fetching an array index from a value of type array{0:'x',1:'y',2:'z'},
found an array index of type string,
but expected the index to be of type int
Open
Open
$k = $defaults[$k];
- Exclude checks
Returning type null
but toImage()
is declared to return string
Open
Open
return null;
- Exclude checks
Argument 2 (needle)
is '&'
but \e_parse::ustrrpos()
takes int
defined at /code/e107_handlers/e_parse_class.php:436
Open
Open
$leftAmp = $this->ustrrpos($this->usubstr($ret, -8), '&');
- Exclude checks
Invalid offset "w"
of array type array{}
Open
Open
$width = varset($parm['w'], 320);
- Exclude checks
Argument 2 (subject)
is ?array|?string|?string[]|?true
but \preg_match_all()
takes string
Open
Open
preg_match_all('#<[^>]+>#', $text, $tags);
- Exclude checks
Returning type false
but thumbUrlSEF()
is declared to return string
Open
Open
return false;
- Exclude checks
Returning type null
but toImage()
is declared to return string
Open
Open
return null;
- Exclude checks
Invalid offset "w"
of array type array{}
Open
Open
return "<img class='img-responsive img-fluid' src='" . $thumbSrc . "' alt='Youtube Video' style='width:" . vartrue($parm['w'], '80') . "px'/>";
- Exclude checks
Argument 1 (text)
is null
but \e_parse_shortcode::parseCodes()
takes string
defined at /code/e107_handlers/shortcode_handler.php:817
Open
Open
return e107::getScParser()->parseCodes($text, $parseSCFiles, $extraCodes, $eVars);
- Exclude checks
Argument 2 (mode)
is 'mix'
but \e_parse::createConstants()
takes int
defined at /code/e107_handlers/e_parse_class.php:3255
Open
Open
$url = $this->createConstants($url, 'mix');
- Exclude checks
Argument 3 (subject)
is ?array|?string|?string[]|?true
but \str_replace()
takes array|string
Open
Open
$text = str_replace(E_NL, $nl_replace, $text);
- Exclude checks