diff --git a/panels.module b/panels.module
index 6374d17..f8be2a0 100644
--- a/panels.module
+++ b/panels.module
@@ -2057,7 +2057,7 @@ function panels_get_pane_links_alter(&$links, $pane, $content_type) {
     $subtype_prefix_hyphen = $exploded_subtype[0] . '-';
 
     // Remove the prefix block- to get the name.
-    $name_of_block = ltrim($prefixed_name, $subtype_prefix_hyphen);
+    $name_of_block = preg_replace("/^$subtype_prefix_hyphen/", '', $prefixed_name, 1);
 
     // Check for user added menus created at /admin/structure/menu/add
     // menus of that type have a subtype that is prefixed with menu-menu-.
