To template.php in Boilerplate :

function mon_vintage_id_safe($string) {
// Replace with dashes anything that isn't A-Z, numbers, dashes, or underscores.
$string = strtolower(preg_replace('/[^a-zA-Z0-9_-]+/', '-', $string));
// If the first character is not a-z, add 'n' in front.
if (!ctype_lower($string{0})) { // Don't use ctype_alpha since its locale aware.
$string = 'id'. $string;
}
return $string;
}

Why on my page I have the warning?:

Notice : Uninitialized string offset: 0 dans mon_vintage_id_safe() (ligne 150 dans C:\wamp\www\respecte-moi.fr\sites\all\themes\boilerplate\template.php).

Thank you for your help

CommentFileSizeAuthor
#3 1450196.patch1.76 KBgrendzy

Comments

danlinn’s picture

Status: Active » Closed (works as designed)
pjnes’s picture

Version: 7.x-1.1 » 7.x-1.x-dev
Assigned: Geeky » Unassigned
Status: Closed (works as designed) » Active

I ran into this same issue, and it wasn't down to the naming issue. I've grepped the theme folder for the word boilerplate and it only finds the mentions in the Readme folder.

Something was sending an empty string to themename_id_safe(). Adding a check to see if the string is not empty before attempting to check the first character fixes it.

  if (!empty($string) && (!ctype_lower($string{0}))) { // Don't use ctype_alpha since its locale aware.
    $string = 'id' . $string;
  }

I'm reopening this just so it gets noticed, unfortunately I don't have time to roll a patch.

grendzy’s picture

Status: Active » Needs review
StatusFileSize
new1.76 KB

Let's just get rid of it, D7 already has a function making class names.

grendzy’s picture

Issue summary: View changes
Status: Needs review » Fixed

committed #3.

Yunus260’s picture

Issue summary: View changes

#2 helped me, thx

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.