forum.coppermine-gallery.net

Support => cpg1.6.x Support => cpg1.6 plugins => Topic started by: KchoPrro on October 30, 2022, 11:33:27 am

Title: Rare symbols in Fancybox caption
Post by: KchoPrro on October 30, 2022, 11:33:27 am
It's funny, I've been using this plugin for a long time and I think it was recently that some words were not encoded correctly (I don't know why).

In the screenshot example, the caption shows "Cigüeñas al Atardecer" and it should read "Cigüeñas al Atardecer".

It happens with many words like "Gamón" vs. "Gamón", "Hipocromático" vs. "Hipocromático", "RÃo" vs. "Río", etc.

Not long ago I installed the plugins Final_Extract (final_extract): v2.7 and Problem Solving CAPTCHA (problem_solving_captcha): v1.2. but I just disabled them and the problem persists. There aren't many images, maybe that's why I hadn't noticed before. Any solution?

Thank you!! :)
Title: Re: Rare symbols in Fancybox caption
Post by: ron4mac on October 30, 2022, 03:20:57 pm
I don't see that behavior on my test site. But you had all the character encoding issues with your database transfer.
I wouldn't normally think is should be necessary, but you could try replacing line 39:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);with:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = htmlentities(bb_decode($txtinfo));in the plugin's codebase.php file.
Title: Re: Rare symbols in Fancybox caption
Post by: KchoPrro on October 30, 2022, 07:24:24 pm
I don't see that behavior on my test site. But you had all the character encoding issues with your database transfer.
I wouldn't normally think is should be necessary, but you could try replacing line 39:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);with:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = htmlentities(bb_decode($txtinfo));in the plugin's codebase.php file.

Solved!, you are a genius! :)

In my codebase.php, the code I had in that line was this:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode(iconv('ISO-8859-1', 'UTF-8', $txtinfo));
Had we solved it before? It seems strange that it has a different encoding than the original file (and I don't usually touch php things myself)
Title: Re: Rare symbols in Fancybox caption
Post by: ron4mac on October 30, 2022, 11:22:21 pm
Didn't know there was the iconv. It may work okay with just the original:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);
Title: Re: Rare symbols in Fancybox caption
Post by: KchoPrro on October 31, 2022, 07:28:25 am
Didn't know there was the iconv. It may work okay with just the original:
Code: [Select]
if ($txtinfo) $obj['opts']['caption'] = bb_decode($txtinfo);

That's right, with the original code it works too  8).

But it's strange, I haven't touched the code (I wouldn't know how to touch it), that's why I have the feeling that we had already talked about this little problem and that's why it was changed. I don't understand anything  ???

Thank you very much ron4mac ;).