]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Fixes #4311. Rewriting all invalid CSS characters to - for plugin id in plugin admin...
authorBrett Profitt <brett.profitt@gmail.com>
Mon, 23 Jan 2012 03:57:10 +0000 (19:57 -0800)
committerBrett Profitt <brett.profitt@gmail.com>
Mon, 23 Jan 2012 03:57:10 +0000 (19:57 -0800)
views/default/object/plugin/full.php
views/default/object/plugin/invalid.php

index 8955178a64ee226b279a58c20cdc20ffb312c6a8..74bd31d1c6128eeec08e6c958bdd438a18462f09 100644 (file)
@@ -21,6 +21,7 @@ $name = $plugin->getManifest()->getName();
 $can_activate = $plugin->canActivate();
 $max_priority = elgg_get_max_plugin_priority();
 $actions_base = '/action/admin/plugins/';
+$css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID());
 
 $ts = time();
 $token = generate_action_token($ts);
@@ -196,7 +197,7 @@ if ($files) {
 
 ?>
 
-<div class="<?php echo $draggable; ?> elgg-plugin <?php echo $active_class ?>" id="<?php echo $plugin->getID(); ?>">
+<div class="<?php echo $draggable; ?> elgg-plugin <?php echo $active_class ?>" id="<?php echo $css_id; ?>">
        <div class="elgg-image-block">
                <div class="elgg-image-alt">
                        <?php if ($links) : ?>
@@ -247,7 +248,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)
                        <div class="pts">
                        <?php 
                                echo elgg_view('output/url', array(
-                                       'href' => "#elgg-plugin-manifest-{$plugin->getID()}",
+                                       'href' => "#elgg-plugin-manifest-$css_id",
                                        'text' => elgg_echo("admin:plugins:label:moreinfo"),
                                        'rel' => 'toggle',
                                ));
@@ -255,7 +256,7 @@ if (elgg_view_exists($settings_view_old) || elgg_view_exists($settings_view_new)
                        </div>
                </div>
        </div>
-       <div class="elgg-plugin-more hidden" id="elgg-plugin-manifest-<?php echo $plugin->getID(); ?>">
+       <div class="elgg-plugin-more hidden" id="elgg-plugin-manifest-<?php echo $css_id; ?>">
 
                <?php
                if ($screenshots_html) {
index bb518cd53c42a24125897f418af232b83cf0b2b2..f24e1836c52469a7caa40e65c678d97e54538c6f 100644 (file)
@@ -16,6 +16,7 @@ $id = $plugin->getID();
 $path = htmlspecialchars($plugin->getPath());
 $message = elgg_echo('admin:plugins:warning:invalid', array($id));
 $error = $plugin->getError();
+$css_id = preg_replace('/[^a-z0-9-]/i', '-', $plugin->getID());
 
 ?>
 
@@ -27,14 +28,14 @@ $error = $plugin->getError();
                <div class="pts">
                        <?php
                                echo elgg_view('output/url', array(
-                                       'href' => "#elgg-plugin-manifest-{$plugin->getID()}",
+                                       'href' => "#elgg-plugin-manifest-$css_id",
                                        'text' => elgg_echo("admin:plugins:label:moreinfo"),
                                        'rel' => 'toggle',
                                ));
                        ?>
                </div>
 
-               <div class="hidden elgg-plugin-more" id="elgg-plugin-manifest-<?php echo $plugin->getID(); ?>">
+               <div class="hidden elgg-plugin-more" id="elgg-plugin-manifest-<?php echo $css_id; ?>">
                        <p><?php echo elgg_echo('admin:plugins:label:location') . ": " . $path; ?></p>
                        <p><?php echo $error; ?></p>
                </div>