Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

news.php and php7 issue #3562

Closed
Jimmi08 opened this issue Nov 28, 2018 · 2 comments
Closed

news.php and php7 issue #3562

Jimmi08 opened this issue Nov 28, 2018 · 2 comments
Labels
core: news type: bug A problem that should not be happening
Milestone

Comments

@Jimmi08
Copy link
Contributor

Jimmi08 commented Nov 28, 2018

in news.php there is code:

$text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSCLAYOUT);

I think it's not compatible with php7.

@Moc
Copy link
Member

Moc commented Nov 28, 2018

Needs replacing with preg_replace_callback()

@Moc Moc added the type: enhancement An improvement or new feature request label Nov 28, 2018
@Jimmi08
Copy link
Contributor Author

Jimmi08 commented Nov 28, 2018

This is similar
#3216
and still no example how to fix it.

I use this way everywhere and it works but there is not your function used.

// $text = preg_replace("/\{(.*?)\}/e", '$\1', $NEWSCLAYOUT);
			$fanat1k_tmp = $NEWSCLAYOUT;				
			preg_match_all("/\{(.*?)\}/", $fanat1k_tmp, $matches);				
			for($i = 0; $i < count($matches[1]); $i++){				
					        $fanat1k_tmp = str_replace("{{$matches[1][$i]}}", ${$matches[1][$i]}, $fanat1k_tmp);				
					}			
		  $text .= $fanat1k_tmp; 

PS: $fanat1k is named on honour for guy who solved this in content plugin.

@Moc Moc added type: bug A problem that should not be happening and removed type: enhancement An improvement or new feature request labels Nov 28, 2018
@Moc Moc added this to the e107 2.2.0 milestone Nov 28, 2018
@Moc Moc added the core: news label Nov 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core: news type: bug A problem that should not be happening
Projects
None yet
Development

No branches or pull requests

2 participants