Advanced search  

News:

cpg1.5.46 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter recently discovered vulnerabilities. It is important that all users who run version cpg1.5.44 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: [Fixed]: [cpg1.5.x]: meta name="keywords" are not separated properly  (Read 26422 times)

0 Members and 1 Guest are viewing this topic.

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Русский (ISO-8859-1) - Russian - (Windows)
    • Makc's home page

For example I have added to keywords to some picture (separate with spaces) as gallery says.

And when I look at HTML source I see this one:
Code: [Select]
<meta name="keywords" content="help tree"/>
But meta name="keywords" must be separated with commas like:
Code: [Select]
<meta name="keywords" content="help,tree"/>
For example you can look at this page's HTML code:
Code: [Select]
<meta name="keywords" content="coppermine,gallery,picture,forum" />
« Last Edit: May 24, 2009, 12:00:42 pm by Joachim Mller »
Logged

Makc666

  • Translator
  • Coppermine addict
  • **
  • Offline Offline
  • Gender: Male
  • Posts: 1608
  • Русский (ISO-8859-1) - Russian - (Windows)
    • Makc's home page
Re: meta name="keywords" are not separated properly
« Reply #1 on: December 02, 2008, 11:01:05 am »

Open:
displayimage.php

Find:
Code: [Select]
if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\"/>"; }
Replace with:
Code: [Select]
if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".preg_replace('/\s+/', ',', $CURRENT_PIC_DATA['keywords'])."\"/>"; }
Logged

Nibbler

  • Guest
Re: meta name="keywords" are not separated properly
« Reply #2 on: December 23, 2008, 07:03:57 pm »

Done for 1.5.
Logged

stunning

  • Coppermine newbie
  • Offline Offline
  • Posts: 1
Re: [cpg1.5.x]: meta name="keywords" are not separated properly
« Reply #3 on: May 16, 2009, 01:45:33 pm »

but i think meta tags are no more useful. from SEO point of view content is the main thing.
Logged

Joachim Mller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: [cpg1.5.x]: meta name="keywords" are not separated properly
« Reply #4 on: May 17, 2009, 07:56:57 am »

Really? Great to hear that. Welcome to the bugs board, where we talk about bugs and not about usefullness of features. Please keep out of the discussion here.
Logged

Joachim Mller

  • Dev Team member
  • Coppermine addict
  • ****
  • Offline Offline
  • Gender: Male
  • Posts: 47844
  • aka "GauGau"
    • gaugau.de
Re: [cpg1.5.x]: meta name="keywords" are not separated properly
« Reply #5 on: May 24, 2009, 12:00:25 pm »

The resources-consuming preg_replace should not be used if you can use the straightforward str_replace

I have replaced
Code: [Select]
if ($CURRENT_PIC_DATA['keywords']) { $meta_keywords = "<meta name=\"keywords\" content=\"".$CURRENT_PIC_DATA['keywords']."\"/>"; }with
Code: [Select]
    if ($CURRENT_PIC_DATA['keywords']) {
    $meta_keywords = "<meta name=\"keywords\" content=\"".rtrim(str_replace(' ', ',', $CURRENT_PIC_DATA['keywords']),',')."\"/>";
    }
in the SVN repository for cpg1.4.x. Marking thread as "fixed" and moving accordingly.
Logged
Pages: [1]   Go Up
 

Page created in 0.014 seconds with 20 queries.