Merge branch 'master' into newui
authorFabio Comuni <fabrix.xm@gmail.com>
Mon, 26 Sep 2011 09:42:48 +0000 (11:42 +0200)
committerFabio Comuni <fabrix.xm@gmail.com>
Mon, 26 Sep 2011 09:42:48 +0000 (11:42 +0200)
12 files changed:
1  2 
boot.php
include/conversation.php
include/template_processor.php
include/text.php
index.php
mod/contacts.php
mod/message.php
mod/network.php
mod/profile.php
mod/search.php
view/jot-header.tpl
view/theme/dispy/jot-header.tpl

diff --cc boot.php
+++ b/boot.php
@@@ -5,12 -5,11 +5,12 @@@ require_once('include/network.php')
  require_once('include/plugin.php');
  require_once('include/text.php');
  require_once("include/pgettext.php");
 +require_once('include/nav.php');
  
  
- define ( 'FRIENDIKA_VERSION',      '2.2.1103' );
+ define ( 'FRIENDIKA_VERSION',      '2.3.1115' );
  define ( 'DFRN_PROTOCOL_VERSION',  '2.21'    );
- define ( 'DB_UPDATE_VERSION',      1087      );
+ define ( 'DB_UPDATE_VERSION',      1092      );
  
  define ( 'EOL',                    "<br />\r\n"     );
  define ( 'ATOM_TIME',              'Y-m-d\TH:i:s\Z' );
@@@ -933,15 -956,17 +936,15 @@@ function profile_sidebar($profile, $blo
        $tpl = get_markup_template('profile_vcard.tpl');
  
        $o .= replace_macros($tpl, array(
 -              '$fullname' => template_escape($fullname),
 -              '$pdesc'    => template_escape($pdesc),
 -              '$tabs'     => $tabs,
 -              '$photo'    => $photo,
 +              '$profile' => $profile,
                '$connect'  => $connect,                
-               '$location' => $location,
+               '$location' => template_escape($location),
                '$gender'   => $gender,
 -              '$pubkey'   => $pubkey,
 -              '$marital'  => template_escape($marital),
 -              '$homepage' => template_escape($homepage),
 -              '$diaspora' => $diaspora_vcard
 +              '$pdesc'        => $pdesc,
 +              '$marital'  => $marital,
 +              '$homepage' => $homepage,
 +              '$diaspora' => $diaspora,
 +              '$contact_block' => $contact_block,
        ));
  
  
@@@ -525,10 -505,9 +525,10 @@@ function conversation(&$a, $items, $mod
                                '$indent' => $indent,
                                '$owner_url' => $owner_url,
                                '$owner_photo' => $owner_photo,
-                               '$owner_name' => $owner_name,
+                               '$owner_name' => template_escape($owner_name),
                                '$plink' => get_plink($item),
                                '$edpost' => $edpost,
 +                              '$isstarred' => $isstarred,
                                '$star' => $star,
                                '$drop' => $drop,
                                '$vote' => $likebuttons,
Simple merge
@@@ -932,6 -925,60 +938,60 @@@ function base64url_decode($s) 
        return base64_decode(strtr($s,'-_','+/'));
  }
  
- function cc_license() {
- return '<div class="cc-license">' . t('Shared content is covered by the <a href="http://creativecommons.org/licenses/by/3.0/">Creative Commons Attribution 3.0</a> license.') . '</div>';
- }
+ if (!function_exists('str_getcsv')) {
+     function str_getcsv($input, $delimiter = ',', $enclosure = '"', $escape = '\\', $eol = '\n') {
+         if (is_string($input) && !empty($input)) {
+             $output = array();
+             $tmp    = preg_split("/".$eol."/",$input);
+             if (is_array($tmp) && !empty($tmp)) {
+                 while (list($line_num, $line) = each($tmp)) {
+                     if (preg_match("/".$escape.$enclosure."/",$line)) {
+                         while ($strlen = strlen($line)) {
+                             $pos_delimiter       = strpos($line,$delimiter);
+                             $pos_enclosure_start = strpos($line,$enclosure);
+                             if (
+                                 is_int($pos_delimiter) && is_int($pos_enclosure_start)
+                                 && ($pos_enclosure_start < $pos_delimiter)
+                                 ) {
+                                 $enclosed_str = substr($line,1);
+                                 $pos_enclosure_end = strpos($enclosed_str,$enclosure);
+                                 $enclosed_str = substr($enclosed_str,0,$pos_enclosure_end);
+                                 $output[$line_num][] = $enclosed_str;
+                                 $offset = $pos_enclosure_end+3;
+                             } else {
+                                 if (empty($pos_delimiter) && empty($pos_enclosure_start)) {
+                                     $output[$line_num][] = substr($line,0);
+                                     $offset = strlen($line);
+                                 } else {
+                                     $output[$line_num][] = substr($line,0,$pos_delimiter);
+                                     $offset = (
+                                                 !empty($pos_enclosure_start)
+                                                 && ($pos_enclosure_start < $pos_delimiter)
+                                                 )
+                                                 ?$pos_enclosure_start
+                                                 :$pos_delimiter+1;
+                                 }
+                             }
+                             $line = substr($line,$offset);
+                         }
+                     } else {
+                         $line = preg_split("/".$delimiter."/",$line);
+    
+                         /*
+                          * Validating against pesky extra line breaks creating false rows.
+                          */
+                         if (is_array($line) && !empty($line[0])) {
+                             $output[$line_num] = $line;
+                         } 
+                     }
+                 }
+                 return $output;
+             } else {
+                 return false;
+             }
+         } else {
+             return false;
+         }
+     }
 -} 
++} 
diff --cc index.php
Simple merge
Simple merge
diff --cc mod/message.php
Simple merge
diff --cc mod/network.php
Simple merge
diff --cc mod/profile.php
Simple merge
diff --cc mod/search.php
Simple merge
Simple merge
Simple merge