]> gitweb.fluxo.info Git - lorea/elgg.git/commitdiff
Merged 5487:5525 from 1.7 to trunk.
authorbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 5 Apr 2010 15:11:05 +0000 (15:11 +0000)
committerbrettp <brettp@36083f99-b078-4883-b0ff-0f9b5a30f544>
Mon, 5 Apr 2010 15:11:05 +0000 (15:11 +0000)
git-svn-id: http://code.elgg.org/elgg/trunk@5621 36083f99-b078-4883-b0ff-0f9b5a30f544

14 files changed:
engine/lib/entities.php
mod/bookmarks/actions/add.php
mod/embed/views/default/embed/media.php
mod/embed/views/default/embed/pagination.php
mod/file/actions/save.php
mod/groups/actions/edit.php
mod/groups/actions/forums/addtopic.php
mod/groups/actions/forums/edittopic.php
mod/members/index.php
mod/members/views/default/members/search.php
mod/messages/actions/send.php
mod/pages/actions/pages/edit.php
views/default/output/url.php
views/failsafe/messages/sanitisation/settings.php

index e3fa0cb52697db0c37455b0b8032f5255ee115f8..3d16e1b3d5fec2801665bf84b6045f95b24bd183 100644 (file)
@@ -146,6 +146,8 @@ abstract class ElggEntity implements
 
                $this->attributes['guid'] = "";
 
+               $this->attributes['subtype'] = $orig_entity->getSubtype();
+
                // copy metadata over to new entity - slightly convoluted due to
                // handling of metadata arrays
                if (is_array($metadata_array)) {
@@ -204,8 +206,6 @@ abstract class ElggEntity implements
         * A: Because overload operators cause problems during subclassing, so we put the code here and
         * create overloads in subclasses.
         *
-        * @todo Move "title" logic to applicable extending classes.
-        *
         * @param string $name
         * @param mixed $value
         */
@@ -216,11 +216,6 @@ abstract class ElggEntity implements
                                return false;
                        }
 
-                       // strip out tags from title
-                       if ($name == 'title') {
-                               $value = strip_tags($value);
-                       }
-
                        $this->attributes[$name] = $value;
                }
                else {
index be2f79f8221f0e82fe433520eeba63f7d7f0bbff..6aa3bf8896ba9b3c00cdf412980b6d5146e1e765 100644 (file)
@@ -12,7 +12,7 @@
 gatekeeper();
 action_gatekeeper();
 //set some required variables
-$title = get_input('title');
+$title = strip_tags(get_input('title'));
 $address = get_input('address');
 $notes = get_input('notes');
 $access = get_input('access');
index 25e63ce7d0646eae3d6337111f5481c890e55fd0..ff05054663479f1b67de1e7b0ff59ca9b73bad6e 100644 (file)
@@ -7,7 +7,7 @@
 <?php
        echo elgg_view('embed/pagination',array(
                                                                                                'offset' => $vars['offset'],
-                                                                                               'baseurl' => $vars['url'] . 'pg/embed/media?internalname=' . $vars['internalname'] . "&amp;simpletype=" . $vars['simpletype'],
+                                                                                               'baseurl' => $vars['url'] . 'pg/embed/media?internalname=' . $vars['internalname'] . "&simpletype=" . $vars['simpletype'],
                                                                                                'limit' => $vars['limit'],
                                                                                                'count' => $vars['count']
                                                                                        ));
index b5a741fcdf15eab3917fa6ddf469ca2d717004bb..ded9f21e185254a81efa356cd74d7c49a2af086b 100644 (file)
@@ -38,6 +38,8 @@
                $nonefound = true;
        }
 
+       $baseurl = $vars['baseurl'];
+
        $totalpages = ceil($count / $limit);
        $currentpage = ceil($offset / $limit) + 1;
 
@@ -97,7 +99,7 @@
                        }
 
                        $curoffset = (($i - 1) * $limit);
-                       $counturl = elgg_http_add_url_query_elements($base_url, array($word => $curoffset));
+                       $counturl = elgg_http_add_url_query_elements($baseurl, array($word => $curoffset));
 
                        if ($curoffset != $offset) {
                                echo " <a onclick=\"javascript:$('.popup .content').load('{$counturl}'); return false\" href=\"#\" class=\"pagination_number\">{$i}</a> ";
index 038e61d835a8215427adfd2bead1bc76afde972c..e2f401e8d90a1a39b5bbfa425de6387549041688 100644 (file)
@@ -11,7 +11,7 @@
        global $CONFIG;
        
        // Get variables
-       $title = get_input("title");
+       $title = strip_tags(get_input("title"));
        $desc = get_input("description");
        $tags = get_input("tags");
        $access_id = (int) get_input("access_id");
index b6eb3eb7139a90ca8ba36ce73905c1bf7724ca69..72cc66e85275b562520801c2999e2b02ce5d2110 100644 (file)
@@ -16,6 +16,9 @@
        $input = array();
        foreach($CONFIG->group as $shortname => $valuetype) {
                $input[$shortname] = get_input($shortname);
+               if ($shortname == 'name') {
+                       $input[$shortname] = strip_tags($input[$shortname]);
+               }
                if ($valuetype == 'tags')
                        $input[$shortname] = string_to_tag_array($input[$shortname]);
        }
index 740ea17aa6c9aef6d92947792b6d18f737274fe6..085e2196ef6c10d044cf8b5cb63ee71c67b5427b 100644 (file)
@@ -18,7 +18,7 @@
            if (!$group_entity->isMember($vars['user'])) forward();
            
        // Get input data
-           $title = get_input('topictitle');
+           $title = strip_tags(get_input('topictitle'));
                $message = get_input('topicmessage');
                $tags = get_input('topictags');
                $access = get_input('access_id');
index 2898c31dcde3a0707bcf0de62175d8611e26cae5..10b54ed61bbe79ba04b66a47aebe5f304eda6d0e 100644 (file)
@@ -19,7 +19,7 @@
      
 
        // Get input data
-           $title = get_input('topictitle');
+           $title = strip_tags(get_input('topictitle'));
                $message = get_input('topicmessage');
                $message_id = get_input('message_id');
                $tags = get_input('topictags');
index 5ad37aa70f9c9ffcaf1de864de535c1268dba7ad..1f3b984e5dfc036d8c586f2ad21592def25ef414 100644 (file)
@@ -60,8 +60,15 @@ switch($filter){
                break;
        // search based on tags
        case "search_tags":
-               $filter_content = trigger_plugin_hook('search','',$tag,"");
-               $filter_content .= list_entities_from_metadata("", $tag, "user", "", "", 10, false, false);
+               $options = array();
+               $options['query'] = $tag;
+               $options['type'] = "user";
+               $options['offset'] = $offset;
+               $options['limit'] = $limit;
+               $results = trigger_plugin_hook('search', 'tags', $options, array());
+               $count = $results['count'];
+               $users = $results['entities'];
+               $filter_content = elgg_view_entity_list($users, $count, $offset, $limit, false, false, true);
                break;
        case "newest":
        case 'default':
index 819d8634ac8c639914b585da07f7868409f4bca3..44930ef53fed40330e8099fa3f7affefa832ac92 100644 (file)
@@ -14,8 +14,6 @@
 <h3><?php echo elgg_echo('members:searchtag'); ?></h3>
 <form id="memberssearchform" action="<?php echo $vars['url']; ?>mod/members/index.php?" method="get">
        <input type="text" name="tag" value="Member tags" onclick="if (this.value=='Member tags') { this.value='' }" class="search_input" />
-       <input type="hidden" name="subtype" value="" />
-       <input type="hidden" name="object" value="user" />
        <input type="hidden" name="filter" value="search_tags" />       
        <input type="submit" value="<?php echo elgg_echo('go'); ?>" />
 </form>
index cf9de8ba59b28d9a9b45d4ff9acaabe484d9148a..314b01809ff8b12fdbe352c6cff5846d430abf32 100644 (file)
@@ -13,7 +13,7 @@
 if (!isloggedin()) forward();
 
 // Get input data
-$title = get_input('title'); // message title
+$title = strip_tags(get_input('title')); // message title
 $message_contents = get_input('message'); // the message
 $send_to = get_input('send_to'); // this is the user guid to whom the message is going to be sent
 $reply = get_input('reply',0); // this is the guid of the message replying to
@@ -58,4 +58,4 @@ unset($_SESSION['msg_contents']);
 system_message(elgg_echo("messages:posted"));
 
 // Forward to the users inbox
-forward('mod/messages/sent.php');
\ No newline at end of file
+forward('mod/messages/sent.php');
index a966232a80af437b190be295beebc9f36165cdca..ba6d0acdc20838065475dc05e5219854721f2853 100644 (file)
@@ -22,6 +22,9 @@
        $input = array();
        foreach($CONFIG->pages as $shortname => $valuetype) {
                $input[$shortname] = get_input($shortname);
+               if ($shortname == 'title') {
+                       $input[$shortname] = strip_tags($input[$shortname]);
+               }
                if ($valuetype == 'tags')
                        $input[$shortname] = string_to_tag_array($input[$shortname]);
        }
index 734df2c19d3940093a7738e7392e4ab68175f30b..7e0281a439fdf57451b68fbc950a159bef9a221d 100644 (file)
 $url = trim($vars['href']);
 
 if (!empty($url)) {
+       if ((substr_count($url, "http://") == 0) && (substr_count($url, "https://") == 0)) { 
+               $url = "http://" . $url; 
+       }
+
        if (array_key_exists('is_action', $vars) && $vars['is_action']) {
                $url = elgg_add_action_tokens_to_url($url);
        }
index 9fabe13a1f92159a3cf4e63c4d41df1abf375695..b4e43a0537c63bafbcf4882275f6ed1ba036771e 100644 (file)
@@ -9,6 +9,19 @@
  * @link http://elgg.org/
  */
 
+$dbuser = '';
+$dbpassword = '';
+$dbname = '';
+$dbhost = 'localhost';
+$dbprefix = 'elgg_';
+if (isset($vars['sticky'])) {
+       $dbuser = $vars['sticky']['CONFIG_DBUSER'];
+       $dbname = $vars['sticky']['CONFIG_DBNAME'];
+       $dbhost = $vars['sticky']['CONFIG_DBHOST'];
+       $dbprefix = $vars['sticky']['CONFIG_DBPREFIX'];
+}
+
+
 if ($vars['settings.php']) {
        echo elgg_echo('installation:settings:dbwizard:savefail');
 ?>
@@ -23,11 +36,11 @@ if ($vars['settings.php']) {
        <h2><?php echo elgg_echo('installation:settings:dbwizard:prompt'); ?></h2>
        <form method="post">
                <table cellpadding="0" cellspacing="10" style="background:#f1f1f1;">
-                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:user'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBUSER]" /></td></tr>
-                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:pass'); ?></td><td valign="top"> <input type="password" name="db_install_vars[CONFIG_DBPASS]" /></td></tr>
-                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:dbname'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBNAME]" /></td></tr>
-                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:host'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBHOST]" value="localhost" /></td></tr>
-                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:prefix'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBPREFIX]" value="elgg_" /></td></tr>
+                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:user'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBUSER]" value="<?php echo $dbuser; ?>" /></td></tr>
+                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:pass'); ?></td><td valign="top"> <input type="password" name="db_install_vars[CONFIG_DBPASS]" value="<?php echo $dbpassword; ?>" /></td></tr>
+                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:dbname'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBNAME]" value="<?php echo $dbname; ?>" /></td></tr>
+                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:host'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBHOST]" value="<?php echo $dbhost; ?>" /></td></tr>
+                       <tr><td valign="top"><?php echo elgg_echo('installation:settings:dbwizard:label:prefix'); ?></td><td valign="top"> <input type="text" name="db_install_vars[CONFIG_DBPREFIX]" value="<?php echo $dbprefix; ?>" /></td></tr>
                </table>
 
                <input type="submit" name="<?php echo elgg_echo('save'); ?>" value="<?php echo elgg_echo('save'); ?>" />