]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
fixed embed plugin for #3544
authorcash <cash.costello@gmail.com>
Sat, 2 Jul 2011 14:17:56 +0000 (10:17 -0400)
committercash <cash.costello@gmail.com>
Sat, 2 Jul 2011 14:17:56 +0000 (10:17 -0400)
mod/embed/start.php
mod/embed/views/default/embed/embed.php
mod/embed/views/default/embed/upload/content.php

index f6f1acc57210c70d693c4db2913b31ed7836c0a6..bdd832b4e36616313f01aea11c1a00ca21a86d8d 100644 (file)
@@ -81,8 +81,10 @@ function embed_page_handler($page) {
                        
                        elgg_sort_3d_array_by_value($sections, 'name');
                        elgg_sort_3d_array_by_value($upload_sections, 'name');
-                       $active_section = get_input('active_section', NULL);
-                       $internal_id = get_input('internal_id', NULL);
+                       $active_section = get_input('active_section', '');
+                       $active_section = preg_replace('[\W]', '', $active_section);
+                       $internal_id = get_input('internal_id', '');
+                       $internal_id = preg_replace('[\W]', '', $internal_id);
 
                        echo elgg_view('embed/embed', array(
                                'sections' => $sections,
index 77ce0369995fee1610f8ba4a557ec6c31338ee1f..2d8de1ca462770916f96e203683029f492259ee0 100644 (file)
@@ -10,7 +10,7 @@
  */
 
 $sections = elgg_extract('sections', $vars, array());
-$active_section = elgg_extract('active_section', $vars, array_shift(array_keys($sections)));
+$active_section = elgg_extract('active_section', $vars, array_shift(array_keys($sections)), false);
 $upload_sections = elgg_extract('upload_sections', $vars, array());
 $internal_id = elgg_extract('internal_id', $vars);
 
@@ -20,8 +20,8 @@ if (!$sections) {
        $content = elgg_view_title(elgg_echo('embed:media'));
        $content .= elgg_view('embed/tabs', $vars);
 
-       $offset = max(0, get_input('offset', 0));
-       $limit = get_input('limit', 5);
+       $offset = (int)max(0, get_input('offset', 0));
+       $limit = (int)get_input('limit', 5);
 
        // build the items and layout.
        if ($active_section == 'upload' || array_key_exists($active_section, $sections)) {
index 24fce811276a5eebfc4fca4c62a7ea805cca2120..8bedf5ad1e6a432172c3d865657325e8dd49ff9a 100644 (file)
@@ -4,6 +4,7 @@
  */
 $upload_sections = elgg_extract('upload_sections', $vars, array());
 $active_section = get_input('active_upload_section', array_shift(array_keys($upload_sections)));
+$active_section = preg_replace('[\W]', '', $active_section);
 
 $options = array();