: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in
namespace Nextend\Framework\Parser;
use Nextend\Framework\Parser\Link\ParserInterface;
use Nextend\Framework\ResourceTranslator\ResourceTranslator;
private static $parsers = array();
public static $registeredNamespaces = array(
'\\Nextend\\Framework\\Parser\\Link\\',
'\\Nextend\\SmartSlider3\\Parser\\Link\\'
public static function parse($url, &$attributes, $isEditor = false) {
if ($url == '#' || $isEditor) {
$attributes['onclick'] = "return false;";
if (substr($url, 0, 11) === "javascript:") {
preg_match('/^([a-zA-Z]+)\[(.*)]$/', $url, $matches);
$matches[1] = ucfirst($matches[1]);
$parser = self::getParser($matches[1]);
$url = $parser->parse($matches[2], $attributes);
$url = ResourceTranslator::toUrl($url);
public static function getParser($className) {
if (!isset(self::$parsers[$className])) {
foreach (self::$registeredNamespaces as $namespace) {
$class = $namespace . $className;
if (class_exists($class)) {
self::$parsers[$className] = new $class();
if (!isset(self::$parsers[$className])) {
self::$parsers[$className] = false;
return self::$parsers[$className];