Commit 33022cf7 authored by lrargerich's avatar lrargerich

Merged 1.4 bugfixes branch into main trunk.

Resolved conflicts.
Fixed a bug when exporting wiki pages.
parent 6fa885c2
......@@ -73,6 +73,26 @@ Version 1.5 -Regulus-
The administrator (but not the user) can also specify the date and time format strings.
Month and weekday names are also localized, if locales are configured correctly on the server.
Version 1.4.2 -Mira-
* [FIX] Fixed a bug that crashed image caching
* [FIX] Fixed a bug that allowed admins with permission to edit templates to
edit any file
* [FIX] Fixed a bug that made unassigned modules remain assigned for
registered users
* [FIX] Now you can use ' in the browser title and other preferences
Version 1.4.1 -Mira-
* [FIX] Fixed a bug that made Tiki unaware of links using the new
((name|description)) syntax resulting in orphan pages and fake
link structure for the Wiki.
* [FIX] Corrected an error in tiki_1.3to1.4.sql, added the params
column to tiki_user_assigned_modules that was missing
* [FIX] Fixed a bug related to an incorrect link when editing the
user personal page as admin fro the user_preferences page
Version 1.4 -Mira-
* [NEW] Quizzes, you can create quizzes with as many multiple-choice questions as you want and program specific answers
......
......@@ -285,11 +285,13 @@ class TikiLib {
$parts = array();
$parts[]=MimeifyPageRevision($info);
if($nversions>1 || $nversions==0) {
foreach ($iter as $revision) {
$parts[] = MimeifyPageRevision($revision);
if ($nversions > 0 && count($parts) >= $nversions)
break;
}
}
if (count($parts) > 1)
return $head . MimeMultipart($parts);
assert($parts);
......@@ -5556,8 +5558,8 @@ class TikiLib {
preg_match_all("/src=\"([^\"]+)\"/",$data,$reqs1);
preg_match_all("/src=\'([^\']+)\'/",$data,$reqs2);
preg_match_all("/src=([A-Za-z0-9\:\?\=\/\\\.\-\_]+)\}/",$data,$reqs3);
preg_match_all("/src=([A-Za-z0-9\:\?\=\/\\\.\-\_]+) /",$data,$reqs3);
$merge = array_merge($reqs1[1],$reqs2[1],$reqs3[1]);
preg_match_all("/src=([A-Za-z0-9\:\?\=\/\\\.\-\_]+) /",$data,$reqs4);
$merge = array_merge($reqs1[1],$reqs2[1],$reqs3[1],$reqs4[1]);
$merge = array_unique($merge);
//print_r($merge);
// Now for each element in the array capture the image and
......@@ -5589,6 +5591,9 @@ class TikiLib {
$img = imagecreatefromstring($data);
$size_x = imagesx($img);
$size_y = imagesy($img);
// Fix the ratio values for system gallery
$gal_info["thumbSizeX"]=90;
$gal_info["thumbSizeY"]=90;
if ($size_x > $size_y)
$tscale = ((int)$size_x / $gal_info["thumbSizeX"]);
else
......@@ -5620,6 +5625,7 @@ class TikiLib {
} else {
//print("No GD detected generating image without thumbnail<br/>");
$imageId = $this->insert_image(0,'','',$name, $type, $data, $size, 100, 100, 'admin','','');
//print("Imagen en $imageId<br/>");
}
// Now change it!
//print("Changing $url to imageId: $imageId");
......@@ -5701,6 +5707,9 @@ class TikiLib {
$query = "delete from tiki_modules where name='$name'";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query,$result);
$query = "delete from tiki_user_assigned_modules where name='$name'";
$result = $this->db->query($query);
if(DB::isError($result)) $this->sql_error($query,$result);
return true;
}
......@@ -6155,7 +6164,6 @@ ImageSetPixel ($dst_img, $i + $dst_x - $src_x, $j + $dst_y - $src_y, ImageColorC
{
global $gal_use_db;
global $gal_use_dir;
$name = addslashes(strip_tags($name));
$description = addslashes(strip_tags($description));
......@@ -6185,7 +6193,6 @@ ImageSetPixel ($dst_img, $i + $dst_x - $src_x, $j + $dst_y - $src_y, ImageColorC
$data='';
$path=$fhash;
}
$query = "insert into tiki_images(galleryId,name,description,filename,filetype,filesize,data,xsize,ysize,user,created,t_data,t_type,hits,path)
values($galleryId,'$name','$description','$filename','$filetype',$size,'$data',$xsize,$ysize,'$user',$now,'$t_data','$t_type',0,'$path')";
$result = $this->db->query($query);
......@@ -7469,7 +7476,7 @@ ImageSetPixel ($dst_img, $i + $dst_x - $src_x, $j + $dst_y - $src_y, ImageColorC
$aux["ip"] = $res["ip"];
$aux["data"] = $res["data"];
$aux["pageName"] = $res["pageName"];
$aux["description"] = $res["description"];
$aux["comment"] = $res["comment"];
//$aux["percent"] = levenshtein($res["data"],$actual);
$ret[]=$aux;
......@@ -8443,7 +8450,8 @@ ImageSetPixel ($dst_img, $i + $dst_x - $src_x, $j + $dst_y - $src_y, ImageColorC
function get_pages($data) {
preg_match_all("/[ \n\t\r^]([A-Z][a-z0-9_\-]+[A-Z][a-z0-9_\-]+[A-Za-z0-9\-_]*)($|[ \n\t\r])/",$data,$pages);
preg_match_all("/\(\(([A-Za-z0-9_\-]+)\)\)/",$data,$pages2);
$pages = array_merge($pages[1],$pages2[1]);
preg_match_all("/\(\(([A-Za-z0-9_\-]+)\|([^\)]+)\)\)/",$data,$pages3);
$pages = array_unique(array_merge($pages[1],$pages2[1],$pages3[1]));
return $pages;
}
......
......@@ -526,6 +526,7 @@ function MimeMultipart ($parts)
function MimeifyPageRevision ($page) {
//$page = $revision->getPage();
// FIXME: add 'hits' to $params
$params = array('pagename' => $page["pageName"],
'flags' => "",
'author' => $page["user"],
......@@ -535,7 +536,9 @@ function MimeifyPageRevision ($page) {
$params["author_id"]=$page["ip"];
$params["summary"]=$page["comment"];
if(isset($page["hits"])) $params["hits"]=$page["hits"];
$params["description"]=$page["description"];
$params['charset'] = 'iso-8859-1';
// Non-US-ASCII is not allowed in Mime headers (at least not without
......
......@@ -91,7 +91,7 @@
<tr><td class="formcolor">{tr}Spellcheck{/tr}: </td><td class="formcolor"><input type="checkbox" name="spellcheck" {if $spellcheck eq 'y'}checked="checked"{/if}/></td>
{/if}
<tr><td class="formcolor">{tr}Publish Date{/tr}</td><td class="formcolor">
{html_select_date time=$publishDate end_year="+1"} at {html_select_time time=$publishDate display_seconds=false}
{html_select_date time=$publishDate start_year="-5" end_year="+1"} at {html_select_time time=$publishDate display_seconds=false}
</td></tr>
</table>
{if $tiki_p_use_HTML eq 'y'}
......
......@@ -45,7 +45,7 @@
</td></tr>
<tr><td class="form">{tr}HomePage{/tr}:</td><td><input type="text" name="homePage" value="{$homePage}" /></td></tr>
{if $feature_wiki eq 'y'}
<tr><td class="form">{tr}Your personal Wiki Page{/tr}:</td><td><a class="link" href="tiki-index.php?page=UserPage{$userinfo.login}">UserPage{$userinfo.login}</a>({tr}<a class="link" href="tiki-editpage.php?page=UserPage{$user}">{tr}edit{/tr}</a>{/tr})</td></tr>
<tr><td class="form">{tr}Your personal Wiki Page{/tr}:</td><td><a class="link" href="tiki-index.php?page=UserPage{$userinfo.login}">UserPage{$userinfo.login}</a>({tr}<a class="link" href="tiki-editpage.php?page=UserPage{$userinfo.login}">{tr}edit{/tr}</a>{/tr})</td></tr>
{/if}
<tr><td class="form">{tr}Displayed time zone{/tr}:</td><td>
......
......@@ -19,6 +19,17 @@ if(!isset($_REQUEST["mode"])) {
$mode = 'listing';
}
// Validate to prevent editing any file
if(isset($_REQUEST["template"])) {
if((substr($_REQUEST["template"],0,10)!='templates/')||(strstr($_REQUEST["template"],'..'))) {
$smarty->assign('msg',tra("You dont have permission to do that"));
$smarty->display('error.tpl');
die;
}
}
if(isset($_REQUEST["save"])) {
$fp = fopen($_REQUEST["template"],"w");
if(!$fp) {
......
......@@ -445,12 +445,12 @@ $smarty->assign('feature_bidi',$feature_bidi);
$prefs = $tikilib->get_all_preferences();
if(!file_exists('templates_c/preferences.php')) {
$fw=fopen('templates_c/preferences.php',"w");
$fw=fopen('templates_c/preferences.php',"wb");
fwrite($fw,'<?php'."\n");
foreach($prefs as $name => $val) {
$$name = $val;
fwrite($fw,'$'.$name."=\"".$val."\";");
fwrite($fw,'$smarty->assign("'.$name.'","'.$val.'");');
fwrite($fw,'$smarty->assign("'.$name.'","'.'$'.$name.'");');
fwrite($fw,"\n");
$smarty->assign("$name",$val);
}
......@@ -701,8 +701,9 @@ if($feature_stats == 'y') {
}
}
if($feature_obzip == 'y') {
ob_start("ob_gzhandler");
}
?>
\ No newline at end of file
?>
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment