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

Custom tags not working on windows server #44

Open
joeck opened this issue Feb 23, 2019 · 4 comments
Open

Custom tags not working on windows server #44

joeck opened this issue Feb 23, 2019 · 4 comments

Comments

@joeck
Copy link

joeck commented Feb 23, 2019

Custom tags are not working on a windows server (IIS).
Specifically, the command PHP_EOL is not working on line 426 in MarkupSEO.module:

private function parseCustom($custom) {
	if(trim($custom) == '') return;
	$return = '';
	$lines = explode(PHP_EOL, $custom);
	foreach($lines as $line) {
		list($key, $value) = explode(':=', $line);
		$key = preg_replace('%[^A-Za-z0-9\-\.\:\_]+%', '', str_replace(' ', '-', trim($key)));	
		$value = trim(wire('sanitizer')->text(html_entity_decode($value)));
		$return[$key] = $value;
	}
	return $return;
}

I changed the delimiter from PHP_EOL to \n and it is now working.
Working code:

private function parseCustom($custom) {
	if(trim($custom) == '') return;
	$return = '';
	$lines = explode("\n", $custom);
	foreach($lines as $line) {
		list($key, $value) = explode(':=', $line);
		$key = preg_replace('%[^A-Za-z0-9\-\.\:\_]+%', '', str_replace(' ', '-', trim($key)));	
		$value = trim(wire('sanitizer')->text(html_entity_decode($value)));
		$return[$key] = $value;
	}
	return $return;
}

I didn't test this on other systems but apparently there are common issues with PHP_EOL
source: https://stackoverflow.com/questions/5508454/how-to-resolve-php-php-eol-issue

@adrianbj
Copy link
Collaborator

@joeck - check out my fork which includes this fix along with many other fixes and new features: https://github.com/adrianbj/MarkupSEO/tree/various-fixes-enhancements

@joeck
Copy link
Author

joeck commented Feb 23, 2019

@adrianbj thank you for linking your fork. Do you have documentation of the new features and fixes? And did you already perform some tests and use it productively?

@adrianbj
Copy link
Collaborator

Sorry, the only documentation is what you can garner from my commit logs. I don't have time to commit to supporting it, but given that Nico is no longer working on this version at all, I figure it's still a better option. My fork is being used on a large / high volume. high profile destination marketing site with no problems.

Perhaps you might also consider @wanze 's new module: https://github.com/wanze/SeoMaestro

@joeck
Copy link
Author

joeck commented Feb 23, 2019

No need to be sorry, I really appreciate the work you did on your fork. I was just curious and would have wanted to take a look if there is documentation.

I did have a look at SeoMaestro but since all the data from the MarkupSEO module is already in the database, I really don't want to fill in all the data again for SeoMaestro. Thanks for the link though!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants