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

Wrong readmore link from getReadAll() when no query string #6

Closed
ReLater opened this issue Apr 1, 2023 · 1 comment
Closed

Wrong readmore link from getReadAll() when no query string #6

ReLater opened this issue Apr 1, 2023 · 1 comment

Comments

@ReLater
Copy link

ReLater commented Apr 1, 2023

Plugin settings

grafik

Tag in Article

{qlwiki url="https://de.wikipedia.org/wiki/Joomla"}

Result

The readmore href is empty instead of https://de.wikipedia.org/wiki/Joomla.

Reason

$url = substr($this->states['url'], 0, strpos($this->states['url'], '?'));

returns an empty string because strpos($this->states['url'], '?') returns false when there is no ? in url.

Temporary solution in method getReadAll()

// get basic url without parameters
if (($strpos = strpos($this->states['url'], '?')) === false)
{
	$strpos = strlen($this->states['url']);
}
$url = substr($this->states['url'], 0, $strpos);
@ReLater ReLater changed the title Wrong link from getReadAll() when no query string Wrong readmore link from getReadAll() when no query string Apr 1, 2023
@hoochicken
Copy link
Owner

Check for Release https://github.com/hoochicken/plg_content_qlwiki/releases/tag/v1.10.2
Changed some stuff, hope I dodn't add more bugs :-)

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