text:
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[45243]
From: <lphuberdeau@us...> - 2013-03-21 14:53
http://sourceforge.net/p/tikiwiki/code/45243
Date:     2013-03-21 14:53:42 +0000 (Thu, 21 Mar 2013)
[FIX] Bad calls to strpos, looking up ? in URL always fails
--- trunk/tiki-editpage.php	2013-03-21 14:33:44 UTC (rev 45242)
+++ trunk/tiki-editpage.php	2013-03-21 14:53:42 UTC (rev 45243)
$url = "location:".$wikilib->sefurl($page);
if (!empty($_REQUEST['page_ref_id'])) {
-			$url .= (strpos('?', $url) === false ? '?' : '&') . 'page_ref_id='.$_REQUEST['page_ref_id'];
+			$url .= (strpos($url, '?') === false ? '?' : '&') . 'page_ref_id='.$_REQUEST['page_ref_id'];
if ($prefs['feature_multilingual'] === 'y' && $prefs['feature_best_language'] === 'y' && isset($info['lang']) && $info['lang'] !== $prefs['language']) {
-		$url .= (strpos('?', $url) === false ? '?' : '&') . 'no_bl=y';
+		$url .= (strpos($url, '?') === false ? '?' : '&') . 'no_bl=y';
if ($dieInsteadOfForwardingWithHeader) die ("-- tiki-editpage: Dying before first call to header(), so we can see traces. Forwarding to: \$url='$url'");
$url = $wikilib->sefurl($page);
if ($prefs['feature_best_language'] === 'y') {
-			$url .= (strpos('?', $url) === false ? '?' : '&') . 'no_bl=y';
+			$url .= (strpos($url, '?') === false ? '?' : '&') . 'no_bl=y';
global $flaggedrevisionlib; require_once 'lib/wiki/flaggedrevisionlib.php';
if ($flaggedrevisionlib->page_requires_approval($page)) {
-				$url .= (strpos('?', $url) === false ? '?' : '&') . 'latest=1';
+				$url .= (strpos($url, '?') === false ? '?' : '&') . 'latest=1';
if ($prefs['flaggedrev_approval'] == 'y' && $tiki_p_wiki_approve == 'y') {
-			$url .= (strpos('?', $url) === false ? '?' : '&') . 'latest=1';
+			$url .= (strpos($url, '?') === false ? '?' : '&') . 'latest=1';
<jonnybradley@us...>
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2008-08-22 15:34
$grammarfile = 'lib/htmlparser/htmlgrammar.cmp';
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-09-06 14:10
-    $smarty->assign('allowhtml','y');
+	$smarty->assign('allowhtml','y');
-  $smarty->assign('allowhtml','n');
+	$edit_data = str_replace( '<x>', '', $edit_data );
+	$smarty->assign('allowhtml','n');
if (empty($_REQUEST['lock_it']) && !empty($info['flag']) && $info['flag'] == 'L') {
$lock_it = 'y';
trunk/tiki-editpage.php	From: <sylvieg@us...> -	2008-10-02 15:02
$info['wysiwyg'] = true;
$smarty->assign('allowhtml','y');
if ( ! isset($_REQUEST['edit']) && ! $is_html ) {
// When we get data from database (i.e. we are not in preview mode) and if we don't allow HTML,
//   then we need to convert database's HTML entities into their "normal chars" equivalents
trunk/tiki-editpage.php	From: <sylvieg@us...> -	2008-10-07 13:23
$edit .= "\r\n";
$edit = substr($info['data'], 0, $real_start).$edit.substr($info['data'], $real_start + $real_len);
+		if (isset($_REQUEST['wysiwyg']) && $_REQUEST['wysiwyg'] == 'y' && $prefs['wysiwyg_wiki_parsed'] == 'y') {//take away the <p> that fck introduces around wiki heading ! to have maketoc/edit section working
+			$edit = preg_replace('/<p>!(.*)<\/p>/u', "!$1\n", $edit);
$tikilib->update_page($_REQUEST["page"],$edit,$_REQUEST["comment"],$user,$_SERVER["REMOTE_ADDR"],$description,$minor,$pageLang, $is_html, $hash, null, $_REQUEST['wysiwyg'], $wiki_authors_style);
trunk/tiki-editpage.php	From: <nyloth@us...> -	2008-10-17 22:03
[FIX] ajax: remove useless calls to xajax in tiki-editpage (it's already automatically done in smarty_setup)
$smarty->assign('edittimeout', (ini_get('session.gc_maxlifetime') / 60 ));
ask_ticket('edit-page');
-$ajaxlib->registerTemplate('tiki-editpage.tpl');
$smarty->assign('metatag_robots', 'NOINDEX, NOFOLLOW');
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2008-10-19 19:26
case "meta": $c[$i]["content"] = ''; break;
case "br": $src .= '%%%'; break;
-	                case "title": $src .= "\n!"; $p['stack'][] = array('tag' => 'title', 'string' => "\n"); break;
+					case "hr": $src .= '---'; break;
+					case "title": $src .= "\n!"; $p['stack'][] = array('tag' => 'title', 'string' => "\n"); break;
case "p": $src .= "\n"; $p['stack'][] = array('tag' => 'p', 'string' => "\n"); break;
case "b": $src .= '__'; $p['stack'][] = array('tag' => 'b', 'string' => '__'); break;
case "i": $src .= "''"; $p['stack'][] = array('tag' => 'i', 'string' => "''"); break;
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-10-27 14:21
['first_tr'] = flag: 'is <table> was just before this <tr>'
-    for ($i=0; $i <= $c["contentpos"]; $i++) {
-        // If content type 'text' output it to destination...
-        if ($c[$i]["type"] == "text") {
-		    if( ! preg_match( '/^\s*$/s', $c[$i]["data"] ) )  {
+	for ($i=0; $i <= $c["contentpos"]; $i++) {
+		// If content type 'text' output it to destination...
+		if ($c[$i]["type"] == "text") {
+			if( ! preg_match( '/^\s*$/s', $c[$i]["data"] ) )  {
$src .= preg_replace( '/^\s+/s', ' ', $c[$i]["data"] );
} elseif ($c[$i]["type"] == "comment") {
$src .= preg_replace( '/<!--/', "\n~hc~", preg_replace( '/-->/', "~/hc~\n", $c[$i]["data"] ));
} elseif ($c[$i]["type"] == "tag") {
-            if ($c[$i]["data"]["type"] == "open") {
-                switch ($c[$i]["data"]["name"])  {
+			if ($c[$i]["data"]["type"] == "open") {
+				switch ($c[$i]["data"]["name"])  {
// Tags we don't want at all.
case "hr": $src .= '---'; break;
case "title": $src .= "\n!"; $p['stack'][] = array('tag' => 'title', 'string' => "\n"); break;
-	                case "p": $src .= "\n"; $p['stack'][] = array('tag' => 'p', 'string' => "\n"); break;
-	                case "b": $src .= '__'; $p['stack'][] = array('tag' => 'b', 'string' => '__'); break;
-	                case "i": $src .= "''"; $p['stack'][] = array('tag' => 'i', 'string' => "''"); break;
-	                case "em": $src .= "''"; $p['stack'][] = array('tag' => 'em', 'string' => "''"); break;
-	                case "strong": $src .= '__'; $p['stack'][] = array('tag' => 'strong', 'string' => '__'); break;
-	                case "u": $src .= "=="; $p['stack'][] = array('tag' => 'u', 'string' => "=="); break;
-	                case "center": $src .= '::'; $p['stack'][] = array('tag' => 'center', 'string' => '::'); break;
-	                case "code": $src .= '-+';  $p['stack'][] = array('tag' => 'code', 'string' => '+-'); break;
-	                case "dd": $src .= ':';  $p['stack'][] = array('tag' => 'dd', 'string' => "\n"); break;
-	                case "dt": $src .= ';';  $p['stack'][] = array('tag' => 'dt', 'string' => ''); break;
-	                // but possible it run faster :) I don't know where is profiler in PHP...
-	                case "h1": $src .= "\n!"; $p['stack'][] = array('tag' => 'h1', 'string' => "\n"); break;
-	                case "h2": $src .= "\n!!"; $p['stack'][] = array('tag' => 'h2', 'string' => "\n"); break;
-	                case "h3": $src .= "\n!!!"; $p['stack'][] = array('tag' => 'h3', 'string' => "\n"); break;
-	                case "h4": $src .= "\n!!!!"; $p['stack'][] = array('tag' => 'h4', 'string' => "\n"); break;
-	                case "h5": $src .= "\n!!!!!"; $p['stack'][] = array('tag' => 'h5', 'string' => "\n"); break;
-	                case "h6": $src .= "\n!!!!!!"; $p['stack'][] = array('tag' => 'h6', 'string' => "\n"); break;
-	                case "pre": $src .= "~pre~\n"; $p['stack'][] = array('tag' => 'pre', 'string' => "~/pre~\n"); break;
-	                case "sub": $src .= "{SUB()}"; $p['stack'][] = array('tag' => 'sub', 'string' => "{SUB}"); break;
-	                case "table": $src .= '||'; $p['stack'][] = array('tag' => 'table', 'string' => '||'); $p['first_tr'] = true; break;
-	                case "tr": $src .= $p['first_tr'] ? '' : "\n"; $p['first_tr'] = false; $p['first_td'] = true; break;
-	                case "td": $src .= $p['first_td'] ? '' : '|'; $p['first_td'] = false; break;
-	                case "ul": $p['listack'][] = '*'; break;
-	                case "ol": $p['listack'][] = '#'; break;
-	                case "li":
-	                    // (ensure '*/#' starts from begining of line)
-	                    $temp_max = count($p['listack']);
-	                    for ($l = ''; strlen($l) < $temp_max; $l .= end($p['listack']));
-	                    $src .= "\n$l ";
-	                case "font":
-	                    if (isset($c[$i]["pars"]["color"]["value"]))  {
-	                        $src .= '~~'.$c[$i]["pars"]["color"]["value"].':';
-	                        $p['stack'][] = array('tag' => 'font', 'string' => '~~');
-	                case "img":
-	                    if (isset($c[$i]["pars"]["src"]["value"]))
-					        if( strstr( $c[$i]["pars"]["src"]["value"], "http:" ) ) {
-							    $src .= '(img src='.$c[$i]["pars"]["src"]["value"].')';
+					case "p": $src .= "\n"; $p['stack'][] = array('tag' => 'p', 'string' => "\n"); break;
+					case "b": $src .= '__'; $p['stack'][] = array('tag' => 'b', 'string' => '__'); break;
+					case "i": $src .= "''"; $p['stack'][] = array('tag' => 'i', 'string' => "''"); break;
+					case "em": $src .= "''"; $p['stack'][] = array('tag' => 'em', 'string' => "''"); break;
+					case "strong": $src .= '__'; $p['stack'][] = array('tag' => 'strong', 'string' => '__'); break;
+					case "u": $src .= "=="; $p['stack'][] = array('tag' => 'u', 'string' => "=="); break;
+					case "center": $src .= '::'; $p['stack'][] = array('tag' => 'center', 'string' => '::'); break;
+					case "code": $src .= '-+';  $p['stack'][] = array('tag' => 'code', 'string' => '+-'); break;
+					case "dd": $src .= ':';  $p['stack'][] = array('tag' => 'dd', 'string' => "\n"); break;
+					case "dt": $src .= ';';  $p['stack'][] = array('tag' => 'dt', 'string' => ''); break;
+					// but possible it run faster :) I don't know where is profiler in PHP...
+					case "h1": $src .= "\n!"; $p['stack'][] = array('tag' => 'h1', 'string' => "\n"); break;
+					case "h2": $src .= "\n!!"; $p['stack'][] = array('tag' => 'h2', 'string' => "\n"); break;
+					case "h3": $src .= "\n!!!"; $p['stack'][] = array('tag' => 'h3', 'string' => "\n"); break;
+					case "h4": $src .= "\n!!!!"; $p['stack'][] = array('tag' => 'h4', 'string' => "\n"); break;
+					case "h5": $src .= "\n!!!!!"; $p['stack'][] = array('tag' => 'h5', 'string' => "\n"); break;
+					case "h6": $src .= "\n!!!!!!"; $p['stack'][] = array('tag' => 'h6', 'string' => "\n"); break;
+					case "pre": $src .= "~pre~\n"; $p['stack'][] = array('tag' => 'pre', 'string' => "~/pre~\n"); break;
+					case "sub": $src .= "{SUB()}"; $p['stack'][] = array('tag' => 'sub', 'string' => "{SUB}"); break;
+					case "table": $src .= '||'; $p['stack'][] = array('tag' => 'table', 'string' => '||'); $p['first_tr'] = true; break;
+					case "tr": $src .= $p['first_tr'] ? '' : "\n"; $p['first_tr'] = false; $p['first_td'] = true; break;
+					case "td": $src .= $p['first_td'] ? '' : '|'; $p['first_td'] = false; break;
+					case "ul": $p['listack'][] = '*'; break;
+					case "ol": $p['listack'][] = '#'; break;
+					case "li":
+						// (ensure '*/#' starts from begining of line)
+						$temp_max = count($p['listack']);
+						for ($l = ''; strlen($l) < $temp_max; $l .= end($p['listack']));
+						$src .= "\n$l ";
+					case "font":
+						if (isset($c[$i]["pars"]["color"]["value"]))  {
+							$src .= '~~'.$c[$i]["pars"]["color"]["value"].':';
+							$p['stack'][] = array('tag' => 'font', 'string' => '~~');
+					case "img":
+						if (isset($c[$i]["pars"]["src"]["value"]))
+							if( strstr( $c[$i]["pars"]["src"]["value"], "http:" ) ) {
+								$src .= '(img src='.$c[$i]["pars"]["src"]["value"].')';
-							    $src .= '(img src='.$head_url.$c[$i]["pars"]["src"]["value"].')';
+								$src .= '(img src='.$head_url.$c[$i]["pars"]["src"]["value"].')';
-	                case "a":
-	                    if (isset($c[$i]["pars"]["href"]["value"])) {
-					        if( strstr( $c[$i]["pars"]["href"]["value"], "http:" )) {
-							    $src .= '['.$c[$i]["pars"]["href"]["value"].'|';
+					case "a":
+						if (isset($c[$i]["pars"]["href"]["value"])) {
+							if( strstr( $c[$i]["pars"]["href"]["value"], "http:" )) {
+								$src .= '['.$c[$i]["pars"]["href"]["value"].'|';
-							    $src .= '['.$head_url.$c[$i]["pars"]["href"]["value"].'|';
+								$src .= '['.$head_url.$c[$i]["pars"]["href"]["value"].'|';
-	                        $p['stack'][] = array('tag' => 'a', 'string' => ']');
-	                    if( isset($c[$i]["pars"]["name"]["value"])) {
-					    	$src .= '{ANAME()}'.$c[$i]["pars"]["name"]["value"].'{ANAME}';
+							$p['stack'][] = array('tag' => 'a', 'string' => ']');
+						if( isset($c[$i]["pars"]["name"]["value"])) {
+							$src .= '{ANAME()}'.$c[$i]["pars"]["name"]["value"].'{ANAME}';
-                switch ($c[$i]["data"]["name"]) {
-	                case "ul":
-	                    if (end($p['listack']) == '*') array_pop($p['listack']);
-	                case "ol":
-	                    if (end($p['listack']) == '#') array_pop($p['listack']);
-	                    $e = end($p['stack']);
-	                    if ($c[$i]["data"]["name"] == $e['tag'])
-	                        $src .= $e['string'];
-	                        array_pop($p['stack']);
+				switch ($c[$i]["data"]["name"]) {
+					case "ul":
+						if (end($p['listack']) == '*') array_pop($p['listack']);
+					case "ol":
+						if (end($p['listack']) == '#') array_pop($p['listack']);
+						$e = end($p['stack']);
+						if ($c[$i]["data"]["name"] == $e['tag'])
+							$src .= $e['string'];
+							array_pop($p['stack']);
-        if (isset($c[$i]["content"])) {
-//            if (substr($src, -1) != " ") $src .= " ";
-            walk_and_parse($c[$i]["content"], $src, $p, $head_url );
+		if (isset($c[$i]["content"])) {
+//			if (substr($src, -1) != " ") $src .= " ";
+			walk_and_parse($c[$i]["content"], $src, $p, $head_url );
* wrapper around zaufi's HTML sucker code just to use the html to wiki bit
$smarty->assign('parsehtml', $parsehtml);
if (isset($_REQUEST['do_suck']) && strlen($suck_url) > 0)
-    //   flags 'strip HTML tags' and 'try to convert HTML to wiki' :)
-        $smarty->assign('msg', tra("Can't import remote HTML page"));
-        $smarty->display("error.tpl");
-    if ($parsehtml == 'y') {
-    $_REQUEST['edit'] .= $sdta;
+	//   flags 'strip HTML tags' and 'try to convert HTML to wiki' :)
+		$smarty->assign('msg', tra("Can't import remote HTML page"));
+	if ($parsehtml == 'y') {
+	$_REQUEST['edit'] .= $sdta;
// if "UserPage" complete with the user name
if ($prefs['feature_wiki_userpage'] == 'y' && $tiki_p_admin != 'y' && $page == $prefs['feature_wiki_userpage_prefix']) {
$smarty->assign('footnote', '');
$smarty->assign('has_footnote', 'n');
if ($prefs['feature_wiki_footnotes'] == 'y') {
-    $smarty->assign('footnote', $footnote);
-      $smarty->assign('has_footnote', 'y');
-    $smarty->assign('parsed_footnote', $tikilib->parse_data($footnote));
-    if (isset($_REQUEST['footnote'])) {
-      check_ticket('edit-page');
-      $smarty->assign('parsed_footnote', $tikilib->parse_data($_REQUEST['footnote']));
-      $smarty->assign('footnote', $_REQUEST['footnote']);
-      if (empty($_REQUEST['footnote'])) {
-        $wikilib->replace_footnote($user, $page, $_REQUEST['footnote']);
+		$smarty->assign('footnote', $footnote);
+			$smarty->assign('has_footnote', 'y');
+		$smarty->assign('parsed_footnote', $tikilib->parse_data($footnote));
+		if (isset($_REQUEST['footnote'])) {
+			check_ticket('edit-page');
+			$smarty->assign('parsed_footnote', $tikilib->parse_data($_REQUEST['footnote']));
+			$smarty->assign('footnote', $_REQUEST['footnote']);
+			if (empty($_REQUEST['footnote'])) {
+				$wikilib->replace_footnote($user, $page, $_REQUEST['footnote']);
if (isset($_REQUEST["templateId"]) && $_REQUEST["templateId"] > 0 && !isset($_REQUEST['preview']) && !isset($_REQUEST['save'])) {
$template_data = $tikilib->get_template($_REQUEST["templateId"]);
$smarty->assign("poll_template",0);
-    $edit_data = $_REQUEST["edit"];
+	$edit_data = $_REQUEST["edit"];
-    if (isset($info['draft'])) {
-	$edit_data = $info['draft']['data'];
-    } elseif (isset($info["data"])) {
+	if (isset($info['draft'])) {
+		$edit_data = $info['draft']['data'];
+	} elseif (isset($info["data"])) {
if ((!empty($_REQUEST['hdr']) || (!empty($_REQUEST['pos']) && isset($_REQUEST['cell']))) && $prefs['wiki_edit_section'] == 'y') {
list($real_start, $real_len) = $tikilib->get_wiki_section($info['data'], $_REQUEST['hdr']);
$edit_data = '';
-	$edit_data = '';
+		$edit_data = '';
$likepages = '';
$smarty->assign_by_ref('likepages', $likepages);
if (isset($prefs['wiki_feature_copyrights']) && $prefs['wiki_feature_copyrights'] == 'y') {
-  if (isset($_REQUEST['copyrightTitle'])) {
-    $smarty->assign('copyrightTitle', $_REQUEST["copyrightTitle"]);
-  if (isset($_REQUEST['copyrightYear'])) {
-    $smarty->assign('copyrightYear', $_REQUEST["copyrightYear"]);
-  if (isset($_REQUEST['copyrightAuthors'])) {
-    $smarty->assign('copyrightAuthors', $_REQUEST["copyrightAuthors"]);
+	if (isset($_REQUEST['copyrightTitle'])) {
+		$smarty->assign('copyrightTitle', $_REQUEST["copyrightTitle"]);
+	if (isset($_REQUEST['copyrightYear'])) {
+		$smarty->assign('copyrightYear', $_REQUEST["copyrightYear"]);
+	if (isset($_REQUEST['copyrightAuthors'])) {
+		$smarty->assign('copyrightAuthors', $_REQUEST["copyrightAuthors"]);
$smarty->assign_by_ref('commentdata', $_REQUEST["comment"]);
} elseif (isset($info['draft'])) {
-    $smarty->assign_by_ref('commentdata',$info['draft']['data']);
+	$smarty->assign_by_ref('commentdata',$info['draft']['data']);
-    $smarty->assign('commentdata', '');
+	$smarty->assign('commentdata', '');
if (isset($info["description"])) {
-	$info['description'] = $info['draft']['description'];
-    $smarty->assign('description', $info["description"]);
-    $description = $info["description"];
+		$info['description'] = $info['draft']['description'];
+	$smarty->assign('description', $info["description"]);
+	$description = $info["description"];
$smarty->assign('description', '');
if ($prefs['wiki_spellcheck'] == 'y') {
-  if (isset($_REQUEST["spellcheck"]) && $_REQUEST["spellcheck"] == 'on') {
-    $parsed = $tikilib->spellcheckreplace($edit_data, $parsed, $prefs['language'], 'editwiki');
-    $smarty->assign('spellcheck', 'y');
-    $smarty->assign('spellcheck', 'n');
+	if (isset($_REQUEST["spellcheck"]) && $_REQUEST["spellcheck"] == 'on') {
+		$parsed = $tikilib->spellcheckreplace($edit_data, $parsed, $prefs['language'], 'editwiki');
+		$smarty->assign('spellcheck', 'y');
+		$smarty->assign('spellcheck', 'n');
$smarty->assign_by_ref('parsed', $parsed);
$smarty->assign('preview',0);
-  if(!empty($obj['parts'])) {
-    for($i=0; $i<count($obj['parts']); $i++)
-      parse_output($obj['parts'][$i], $parts,$i);
-    switch($obj['type']) {
-      case 'application/x-tikiwiki':
-         $aux["body"] = $obj['body'];
-         $ccc=$obj['header']["content-type"];
+	if(!empty($obj['parts'])) {
+		for($i=0; $i<count($obj['parts']); $i++)
+			parse_output($obj['parts'][$i], $parts,$i);
+	}elseif( $obj['type'] == 'application/x-tikiwiki' ) {
+		$aux["body"] = $obj['body'];
+		$ccc=$obj['header']["content-type"];
+		$items = split(';',$ccc);
+			$portions = split('=',$item);
if (isset($_REQUEST["save"]) && (strtolower($_REQUEST['page']) != 'sandbox' || $tiki_p_admin == 'y') && !$category_needed && !$contribution_needed) {
-  check_ticket('edit-page');
-  if(!isset($_REQUEST["description"])) $_REQUEST["description"]='';
-  if(!isset($_REQUEST["wiki_authors_style"])) $_REQUEST["wiki_authors_style"]='';
-  if(!isset($_REQUEST["comment"])) $_REQUEST["comment"]='';
-  if(!isset($_REQUEST["lang"])) $_REQUEST["lang"]='';
-  if(!isset($_REQUEST['wysiwyg'])) $_REQUEST['wysiwyg'] = '';
-  if(isset($_REQUEST['wiki_cache'])) {
-    $wikilib->set_page_cache($_REQUEST['page'],$_REQUEST['wiki_cache']);
-  include_once("lib/imagegals/imagegallib.php");
-  $cat_desc = ($prefs['feature_wiki_description'] == 'y') ? substr($_REQUEST["description"],0,200) : '';
-  $cat_name = $_REQUEST["page"];
-  $cat_href="tiki-index.php?page=".urlencode($cat_objid);
-  $cat_lang = $_REQUEST['lang'];
-  include_once("categorize.php");
-  include_once("poll_categorize.php");
-  include_once("freetag_apply.php");
-    $page = $_REQUEST["page"];
-      $edit = $_REQUEST["edit"];
-      $edit = htmlspecialchars($_REQUEST['edit']);
-    if(isset($prefs['wiki_feature_copyrights']) && $prefs['wiki_feature_copyrights'] == 'y'
-      && isset($_REQUEST['copyrightTitle'])
-      && isset($_REQUEST['copyrightYear'])
-      && isset($_REQUEST['copyrightAuthors'])
-      && !empty($_REQUEST['copyrightYear'])
-      && !empty($_REQUEST['copyrightTitle'])
-      include_once("lib/copyrights/copyrightslib.php");
-      $copyrightYear = $_REQUEST['copyrightYear'];
-      $copyrightTitle = $_REQUEST['copyrightTitle'];
-      $copyrightAuthors = $_REQUEST['copyrightAuthors'];
+	check_ticket('edit-page');
+	if(!isset($_REQUEST["description"])) $_REQUEST["description"]='';
+	if(!isset($_REQUEST["wiki_authors_style"])) $_REQUEST["wiki_authors_style"]='';
+	if(!isset($_REQUEST["comment"])) $_REQUEST["comment"]='';
+	if(!isset($_REQUEST["lang"])) $_REQUEST["lang"]='';
+	if(!isset($_REQUEST['wysiwyg'])) $_REQUEST['wysiwyg'] = '';
+	if(isset($_REQUEST['wiki_cache'])) {
+		$wikilib->set_page_cache($_REQUEST['page'],$_REQUEST['wiki_cache']);
+	include_once("lib/imagegals/imagegallib.php");
+	$cat_desc = ($prefs['feature_wiki_description'] == 'y') ? substr($_REQUEST["description"],0,200) : '';
+	$cat_name = $_REQUEST["page"];
+	$cat_href="tiki-index.php?page=".urlencode($cat_objid);
+	$cat_lang = $_REQUEST['lang'];
+	include_once("categorize.php");
+	include_once("poll_categorize.php");
+	include_once("freetag_apply.php");
+	$page = $_REQUEST["page"];
+		$edit = $_REQUEST["edit"];
+		$edit = htmlspecialchars($_REQUEST['edit']);
+		isset($prefs['wiki_feature_copyrights'])
+		&& $prefs['wiki_feature_copyrights'] == 'y'
+		&& isset($_REQUEST['copyrightTitle'])
+		&& isset($_REQUEST['copyrightYear'])
+		&& isset($_REQUEST['copyrightAuthors'])
+		&& !empty($_REQUEST['copyrightYear'])
+		&& !empty($_REQUEST['copyrightTitle']
+		include_once("lib/copyrights/copyrightslib.php");
+		$copyrightYear = $_REQUEST['copyrightYear'];
+		$copyrightTitle = $_REQUEST['copyrightTitle'];
+		$copyrightAuthors = $_REQUEST['copyrightAuthors'];
$exist = $tikilib->page_exists($_REQUEST['page']);
if (!$exist && $prefs['feature_wikiapproval'] == 'y' && $prefs['wikiapproval_delete_staging'] == 'y' && substr($_REQUEST['page'], 0, strlen($prefs['wikiapproval_prefix'])) == $prefs['wikiapproval_prefix']) { //needs to create the first history = initial page for history
$approvedPageName = substr($_REQUEST['page'], strlen($prefs['wikiapproval_prefix']));
-      $links = $tikilib->get_links($_REQUEST["edit"]);
-      $notcachedlinks = $tikilib->get_links_nocache($_REQUEST["edit"]);
-      $tikilib->create_page($_REQUEST["page"], 0, $edit, $tikilib->now, $_REQUEST["comment"],$user,$_SERVER["REMOTE_ADDR"],$description, $pageLang, $is_html, $hash, $_REQUEST['wysiwyg'], $wiki_authors_style);
+		$links = $tikilib->get_links($_REQUEST["edit"]);
+		   $notcachedlinks = $tikilib->get_links_nocache($_REQUEST["edit"]);
+		$tikilib->create_page($_REQUEST["page"], 0, $edit, $tikilib->now, $_REQUEST["comment"],$user,$_SERVER["REMOTE_ADDR"],$description, $pageLang, $is_html, $hash, $_REQUEST['wysiwyg'], $wiki_authors_style);
-      if ($prefs['wiki_watch_author'] == 'y') {
-        $tikilib->add_user_watch($user,"wiki_page_changed",$_REQUEST["page"],'wiki page',$page,"tiki-index.php?page=$page");
+		if ($prefs['wiki_watch_author'] == 'y') {
+			$tikilib->add_user_watch($user,"wiki_page_changed",$_REQUEST["page"],'wiki page',$page,"tiki-index.php?page=$page");
$sourceInfo = $tikilib->get_page_info( $_REQUEST['translationOf'] );
if( !isset($_REQUEST['partial_save']) ) {
-						'wiki page',
-						$sourceInfo['page_id'],
-						$targetInfo['page_id'],
-						$sourceInfo['version'],
-						$targetInfo['version'] );
+							'wiki page',
+							$sourceInfo['page_id'],
+							$targetInfo['page_id'],
+							$sourceInfo['version'],
+							$targetInfo['version'] );
-  if (isset($_REQUEST['current_page_id']) ) {
-    $page_info = $structlib->s_get_page_info($_REQUEST['current_page_id']);
+	if (isset($_REQUEST['current_page_id']) ) {
+		$page_info = $structlib->s_get_page_info($_REQUEST['current_page_id']);
$pageAlias = $page_info['page_alias'];
-    if (isset($_REQUEST["add_child"]) ) {
-      $subpages = $structlib->s_get_pages($_REQUEST["current_page_id"]);
-        $last_child_ref_id = $last_child["page_ref_id"];
-    $page_ref_id = $structlib->s_create_page($_REQUEST['current_page_id'], $last_child_ref_id, $_REQUEST["page"], '');
-      $page_ref_id = $structlib->s_create_page($page_info["parent_id"], $_REQUEST['current_page_id'], $_REQUEST["page"], '');
-    //Criss Holman added the if containing this code of which I don't know the use, but a check before the permissions copy
-    if ($tikilib->user_has_perm_on_object($user, $_REQUEST["page"],'wiki page', 'tiki_p_admin_wiki', 'tiki_p_admin_categories'))
-    $userlib->copy_object_permissions($page_info["pageName"], $_REQUEST["page"],'wiki page');
+		if (isset($_REQUEST["add_child"]) ) {
+			$subpages = $structlib->s_get_pages($_REQUEST["current_page_id"]);
+				$last_child_ref_id = $last_child["page_ref_id"];
+			$page_ref_id = $structlib->s_create_page($_REQUEST['current_page_id'], $last_child_ref_id, $_REQUEST["page"], '');
+			$page_ref_id = $structlib->s_create_page($page_info["parent_id"], $_REQUEST['current_page_id'], $_REQUEST["page"], '');
+		//Criss Holman added the if containing this code of which I don't know the use, but a check before the permissions copy
+		if ($tikilib->user_has_perm_on_object($user, $_REQUEST["page"],'wiki page', 'tiki_p_admin_wiki', 'tiki_p_admin_categories'))
+			$userlib->copy_object_permissions($page_info["pageName"], $_REQUEST["page"],'wiki page');
$url = "tiki-index.php?page_ref_id=$page_ref_id";
-  if ($prefs['feature_best_language'] == 'y') {
+	if ($prefs['feature_best_language'] == 'y') {
$url .= '&bl=n';
-  $url .= '&saved_msg=y';
+	$url .= '&saved_msg=y';
-  header("location: $url");
+	header("location: $url");
$smarty->assign('pageAlias',$pageAlias);
if ($prefs['feature_wiki_templates'] == 'y' && $tiki_p_use_content_templates == 'y') {
-  $templates = $tikilib->list_templates('wiki', 0, -1, 'name_asc', '');
-  $smarty->assign_by_ref('templates', $templates["data"]);
+	$templates = $tikilib->list_templates('wiki', 0, -1, 'name_asc', '');
+	$smarty->assign_by_ref('templates', $templates["data"]);
if ($prefs['feature_polls'] =='y' and $prefs['feature_wiki_ratings'] == 'y' && $tiki_p_wiki_admin_ratings == 'y') {
function pollnameclean($s) { global $page; if (isset($s['title'])) $s['title'] = substr($s['title'],strlen($page)+2); return $s; }
$smarty->assign('polls_templates',$polls_templates['data']);
if (isset($poll_rated['title'])) {
-		$poll_rated  = array_map('pollnameclean',$poll_rated);
+		$poll_rated = array_map('pollnameclean',$poll_rated);
$smarty->assign('poll_rated',$poll_rated);
if (isset($_REQUEST['poll_title'])) {
include_once ('freetag_list.php');
if ( isset($_REQUEST['freetag_string']) ) {
-	    $smarty->assign('taglist', $_REQUEST['freetag_string']);
+		$smarty->assign('taglist', $_REQUEST['freetag_string']);
$tags = $freetaglib->get_all_tags_on_object_for_language($_REQUEST['translationOf'], 'wiki page', $pageLang);
$smarty->assign( 'taglist', implode( ' ', $tags ) );
$smarty->assign_by_ref('plugins', $plugins);
$smarty->assign('showstructs', array());
if ($structlib->page_is_in_structure($_REQUEST["page"])) {
-  $structs = $structlib->get_page_structures($_REQUEST["page"]);
+	$structs = $structlib->get_page_structures($_REQUEST["page"]);
// Flag for 'page bar' that currently 'Edit' mode active
$smarty->assign('categ_checked', 'n');
if (isset($_REQUEST['cat_categorize'])) {
-  if ($_REQUEST['cat_categorize'] == 'on') {
-    $smarty->assign('categ_checked', 'y');
+	if ($_REQUEST['cat_categorize'] == 'on') {
+		$smarty->assign('categ_checked', 'y');
if ($prefs['wiki_feature_copyrights'] == 'y' && $tiki_p_edit_copyrights == 'y') {
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-10-27 14:22
&& isset($_REQUEST['copyrightYear'])
&& isset($_REQUEST['copyrightAuthors'])
&& !empty($_REQUEST['copyrightYear'])
-		&& !empty($_REQUEST['copyrightTitle']
+		&& !empty($_REQUEST['copyrightTitle'])
include_once("lib/copyrights/copyrightslib.php");
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-10-27 14:42
for ($i=0; $i <= $c["contentpos"]; $i++) {
// If content type 'text' output it to destination...
if ($c[$i]["type"] == "text") {
-			if( ! preg_match( '/^\s*$/s', $c[$i]["data"] ) )  {
-				$src .= preg_replace( '/^\s+/s', ' ', $c[$i]["data"] );
+			if( ! ctype_space( $c[$i]["data"] ) )  {
+				$add = preg_replace( '/^\s+/s', ' ', $c[$i]["data"] );
switch ($c[$i]["data"]["name"]) {
if (end($p['listack']) == '*') array_pop($p['listack']);
+						if( empty($p['listack']) )
+							$src .= "\n";
if (end($p['listack']) == '#') array_pop($p['listack']);
$e = end($p['stack']);
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-10-28 13:33
if( ! ctype_space( $c[$i]["data"] ) )  {
-				$add = preg_replace( '/^\s+/s', ' ', $c[$i]["data"] );
+				$add = ltrim( $c[$i]["data"] );
+				$add = str_replace( array("\r","\n"), ' ', $add );
case "em": $src .= "''"; $p['stack'][] = array('tag' => 'em', 'string' => "''"); break;
case "strong": $src .= '__'; $p['stack'][] = array('tag' => 'strong', 'string' => '__'); break;
case "u": $src .= "=="; $p['stack'][] = array('tag' => 'u', 'string' => "=="); break;
+					case "strike": $src .= "--"; $p['stack'][] = array('tag' => 'strike', 'string' => "--"); break;
+					case "del": $src .= "--"; $p['stack'][] = array('tag' => 'del', 'string' => "--"); break;
case "center": $src .= '::'; $p['stack'][] = array('tag' => 'center', 'string' => '::'); break;
case "code": $src .= '-+';  $p['stack'][] = array('tag' => 'code', 'string' => '+-'); break;
case "dd": $src .= ':';  $p['stack'][] = array('tag' => 'dd', 'string' => "\n"); break;
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-10-28 14:10
$p['stack'][] = array('tag' => $c[$i]['data']['name'], 'string' => "\n");
+					case "span":
+						if( isset($c[$i]['pars'])
+							&& isset($c[$i]['pars']['style'])
+							&& preg_match( "/background(\-color)?: rgb\((\d+), (\d+), (\d+)\)/", $c[$i]['pars']['style']['value'], $parts ) ) {
+							$src .= "~~#"
+								. str_pad( dechex( 255-$parts[1] ), 2, '0', STR_PAD_LEFT )
+								. str_pad( dechex( 255-$parts[2] ), 2, '0', STR_PAD_LEFT )
+								. str_pad( dechex( 255-$parts[3] ), 2, '0', STR_PAD_LEFT )
+								. ',#'
+								. str_pad( dechex( $parts[1] ), 2, '0', STR_PAD_LEFT )
+								. str_pad( dechex( $parts[2] ), 2, '0', STR_PAD_LEFT )
+								. str_pad( dechex( $parts[3] ), 2, '0', STR_PAD_LEFT )
+								. ':';
+							$p['stack'][] = array('tag' => 'span', 'string' => "~~");
+						} elseif( isset($c[$i]['pars'])
+							&& preg_match( "/color: rgb\((\d+), (\d+), (\d+)\)/", $c[$i]['pars']['style']['value'], $parts ) ) {
$parsed = $tikilib->parse_data($edit_data,array('absolute_links'=>true, 'noparseplugins'=>true,'noheaderinc'=>true));
$parsed = preg_replace('/<span class=\"img\">(.*?)<\/span>/im','$1', $parsed);					// remove spans round img's
$parsed = preg_replace("/src=\"img\/smiles\//im","src=\"".$tikiroot."img/smiles/", $parsed);	// fix smiley src's
+		array( '{SUP()}', '{SUP}', '{SUB()}', '{SUB}' ),
+		array( '<sup>', '</sup>', '<sub>', '</sub>' ),
$smarty->assign('pagedata', $parsed);
$prefs['wiki_edit_section'] = $secedit;
$prefs['feature_wiki_ext_icon'] = $exticons;
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-10-28 14:19
-		array( '{SUP()}', '{SUP}', '{SUB()}', '{SUB}' ),
-		array( '<sup>', '</sup>', '<sub>', '</sub>' ),
+		array( '{SUP()}', '{SUP}', '{SUB()}', '{SUB}', '<table' ),
+		array( '<sup>', '</sup>', '<sub>', '</sub>', '<table border="1"' ),
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2008-10-29 16:43
&& isset($c[$i]['pars']['style'])
&& preg_match( "/background(\-color)?: rgb\((\d+), (\d+), (\d+)\)/", $c[$i]['pars']['style']['value'], $parts ) ) {
$src .= "~~#"
-								. str_pad( dechex( 255-$parts[1] ), 2, '0', STR_PAD_LEFT )
. str_pad( dechex( 255-$parts[2] ), 2, '0', STR_PAD_LEFT )
. str_pad( dechex( 255-$parts[3] ), 2, '0', STR_PAD_LEFT )
+								. str_pad( dechex( 255-$parts[4] ), 2, '0', STR_PAD_LEFT )
. ',#'
-								. str_pad( dechex( $parts[1] ), 2, '0', STR_PAD_LEFT )
. str_pad( dechex( $parts[2] ), 2, '0', STR_PAD_LEFT )
. str_pad( dechex( $parts[3] ), 2, '0', STR_PAD_LEFT )
+								. str_pad( dechex( $parts[4] ), 2, '0', STR_PAD_LEFT )
. ':';
$p['stack'][] = array('tag' => 'span', 'string' => "~~");
} elseif( isset($c[$i]['pars'])
trunk/tiki-editpage.php	From: <nkoth@us...> -	2009-05-27 23:00
proval was turned on, even if the "Always redirect to edit staging page if not i
n the following group" feature was set to blank. Blank setting should turn this
-if ($prefs['feature_wikiapproval'] == 'y' && substr($_REQUEST['page'], 0, strlen($prefs['wikiapproval_prefix'])) != $prefs['wikiapproval_prefix'] && isset($prefs['wikiapproval_master_group']) && !in_array($prefs['wikiapproval_master_group'], $tikilib->get_user_groups($user))) {
+if ($prefs['feature_wikiapproval'] == 'y' && substr($_REQUEST['page'], 0, strlen($prefs['wikiapproval_prefix'])) != $prefs['wikiapproval_prefix'] && $prefs['wikiapproval_master_group'] && !in_array($prefs['wikiapproval_master_group'], $tikilib->get_user_groups($user))) {
$_REQUEST['page'] = $prefs['wikiapproval_prefix'] . $_REQUEST['page'];
trunk/tiki-editpage.php	From: <dexl_2000@us...> -	2009-06-12 06:46
-if ($prefs['feature_wikiapproval'] == 'y' && substr($_REQUEST['page'], 0, strlen($prefs['wikiapproval_prefix'])) != $prefs['wikiapproval_prefix'] && $prefs['wikiapproval_master_group'] && !in_array($prefs['wikiapproval_master_group'], $tikilib->get_user_groups($user))) {
+if ($prefs['feature_wikiapproval'] == 'y' && substr($_REQUEST['page'], 0, strlen($prefs['wikiapproval_prefix'])) != $prefs['wikiapproval_prefix'] && !empty($prefs['wikiapproval_master_group']) && !in_array($prefs['wikiapproval_master_group'], $tikilib->get_user_groups($user))) {
trunk/tiki-editpage.php	From: <alain_desilets@us...> -	2009-06-22 20:58
$_REQUEST["edit"] = $template_data["content"]."\n".$_REQUEST["edit"];
trunk/tiki-editpage.php	From: <sylvieg@us...> -	2009-08-17 20:27
if ($prefs['feature_wikiapproval'] == 'y' && substr($_REQUEST['page'], 0, strlen($prefs['wikiapproval_prefix'])) != $prefs['wikiapproval_prefix'] && !empty($prefs['wikiapproval_master_group']) && !in_array($prefs['wikiapproval_master_group'], $tikilib->get_user_groups($user))) {
$smarty->assign_by_ref('page', $_REQUEST["page"]);
$tikilib->get_perm_object($page, 'wiki page', $info, true);
trunk/tiki-editpage.php	From: <mangapower@us...> -	2009-10-08 15:34
$tikilib->update_page($pagename, $part["body"], tra('page imported'), $author, $authorid, $description, 0, $pageLang, false, $hash);
$tikilib->create_page($pagename, $hits, $part["body"], $lastmodified, tra('created from import'), $author, $authorid, $description, $pageLang, false, $hash);
+						global $perspectivelib; require_once 'lib/perspectivelib.php';
+						global $wslib; require_once 'lib/workspaces/wslib.php';
+						// If there's a WS active and the WS has a homepage, then load the WS homepage
+							$wslib->add_ws_object($preferences['wsId'],$pagename,'wiki page');
$tikilib->create_page($_REQUEST["page"], 0, $edit, $tikilib->now, $_REQUEST["comment"],$user,$tikilib->get_ip_address(),$description, $pageLang, $is_html, $hash, $_REQUEST['wysiwyg'], $wiki_authors_style);
+		global $perspectivelib; require_once 'lib/perspectivelib.php';
+		global $wslib; require_once 'lib/workspaces/wslib.php';
+		// If there's a WS active and the WS has a homepage, then load the WS homepage
+			$wslib->add_ws_object($preferences['wsId'],$_REQUEST["page"],'wiki page');
trunk/tiki-editpage.php	From: <alain_desilets@us...> -	2009-10-09 23:46
- Do not insert preview when creating page based on a template. It confuses users because they clicked on something for creating a page, yet all they see on the screen is a read-only version of the page. They often don't realise that if they scroll down, they can get to an edit box for modifying the template. I have seen this many times when I taught workshops or gave demos on the terminology profile.
$smarty->assign("templateId", $_REQUEST["templateId"]);
trunk/tiki-editpage.php	From: Marc Laporte <marc@ma...> -	2009-10-10 00:34
> - Do not insert preview when creating page based on a template. It confuses users because they clicked on something for creating a page, yet all they see on the screen is a read-only version of the page. They often don't realise that if they scroll down, they can get to an edit box for modifying the template. I have seen this many times when I taught workshops or gave demos on the terminology profile.
>  if (isset($_REQUEST["templateId"]) && $_REQUEST["templateId"] > 0 && !isset($_REQUEST['preview']) && !isset($_REQUEST['save'])) {
>        $template_data = $tikilib->get_template($_REQUEST["templateId"]);
>        $_REQUEST["edit"] = $template_data["content"]."\n".$_REQUEST["edit"];
> -       $_REQUEST["preview"] = 1;
>        $smarty->assign("templateId", $_REQUEST["templateId"]);
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2009-10-14 18:29
-$auto_query_args = array('wysiwyg','page_id','page', 'lang');
+$auto_query_args = array('wysiwyg','page_id','page', 'lang', 'hdr');
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2009-10-21 14:07
-					if ( is_uploaded_file($_FILES['flash_screencast']['tmp_name'][$i]) ) {
+					if ( is_uploaded_file($_FILES['ogg_screencast']['tmp_name'][$i]) ) {
if ( preg_match("/\.(ogg)$/", $_FILES['ogg_screencast']['name'][$i], $ext) ) {
if ( !$screencastlib->add($_FILES['ogg_screencast']['tmp_name'][$i], $hashedFileName . "-" . $i . "." .  $ext[1])) {
$screencastErrors[] = tra("An unexpected error occurred while uploading your Ogg screencast!");
trunk/tiki-editpage.php	From: <sept_7@us...> -	2009-10-30 15:18
-		for($i=0; $i<count($obj['parts']); $i++)
+		foreach( $obj['parts'] as $index => $part ) {
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2009-12-22 15:17
$is_staging_article = ($prefs['wikiapproval_staging_category'] > 0) && (in_array($prefs['wikiapproval_staging_category'], $cats));
-$page_badchars_display = ":/?#[]@!$&'()*+,;=";
-$page_badchars = "/[:\/?#\[\]@!$&'()*+,;=]/";
+$page_badchars_display = ":/?#[]@!$&'()*+,;=<>";
+$page_badchars = "/[:\/?#\[\]@!$&'()*+,;=<>]/";
if ($is_staging_article && (mb_substr($page, 0, 1) == $prefs['wikiapproval_prefix'])) {
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[24017]
trunk/tiki-editpage.php	From: <sylvieg@us...> -	2009-12-23 17:50
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24017&view=rev
-	$pageHash = md5( $pageLang . '/' . $this->get_approved_page_or_self( $page ) );
+	$pageHash = md5( $pageLang . '/' . $tikilib->get_approved_page_or_self( $page ) );
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[24032]
trunk/tiki-editpage.php	From: <alain_desilets@us...> -	2009-12-24 16:26
Revision: 24032
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24032&view=rev
Date:     2009-12-24 16:26:08 +0000 (Thu, 24 Dec 2009)
- Fixed small bug in r24025. While templates worked when creating page from Terminology module, you could not apply templates when creating a page in other ways.
--- trunk/tiki-editpage.php	2009-12-24 16:06:03 UTC (rev 24031)
+++ trunk/tiki-editpage.php	2009-12-24 16:26:08 UTC (rev 24032)
-if ((isset($_REQUEST["template_name"]) || isset($_REQUEST["template_id"])) && !isset($_REQUEST['preview']) && !isset($_REQUEST['save'])) {
+if ((isset($_REQUEST["template_name"]) || isset($_REQUEST["templateId"])) && !isset($_REQUEST['preview']) && !isset($_REQUEST['save'])) {
-	if (isset($_REQUEST["template_id"]))  {
-		$template_id = $_REQUEST["template_id"];
+	if (isset($_REQUEST["templateId"]))  {
+		$templateId = $_REQUEST["templateId"];
-		$template_id = $multilinguallib->getTemplateIDInLanguage('wiki', $_REQUEST["template_name"], $templateLang);
+		$templateId = $multilinguallib->getTemplateIDInLanguage('wiki', $_REQUEST["template_name"], $templateLang);
+	$template_data = $templateslib->get_template($templateId, $templateLang);
-	$smarty->assign("templateId", $template_id);
+	$smarty->assign("templateId", $templateId);
if (isset($_REQUEST["categId"]) && $_REQUEST["categId"] > 0) {
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[24457]
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2010-01-18 00:28
Revision: 24457
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24457&view=rev
Date:     2010-01-18 00:23:39 +0000 (Mon, 18 Jan 2010)
[ENH] If wiki_mandatory_edit_summary and no comment entered show prompt dialogue box for one to be entered (closes wish2087?)
--- trunk/tiki-editpage.php	2010-01-17 23:55:13 UTC (rev 24456)
+++ trunk/tiki-editpage.php	2010-01-18 00:23:39 UTC (rev 24457)
@@ -988,6 +988,18 @@
$summary_needed = false;
+if ($prefs['wiki_mandatory_edit_summary'] == 'y') {
+	$headerlib->add_jq_onready('
+$jq("input[name=save],input[name=minor]").click(function(){
+	if (!$jq("#comment").val()) {
+		var s = prompt("'.tra('Describe the change you made').'");
+		if (!s) return false;
+		$jq("#comment").val(s);
if (isset($_REQUEST["save"]) && (strtolower($_REQUEST['page']) != 'sandbox' || $tiki_p_admin == 'y') && !$category_needed && !$contribution_needed && ! $summary_needed) {
check_ticket('edit-page');
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[24623]
trunk/tiki-editpage.php	From: <alain_desilets@us...> -	2010-01-23 19:41
Revision: 24623
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24623&view=rev
Date:     2010-01-23 19:41:34 +0000 (Sat, 23 Jan 2010)
Small change (uncommented for now) towards transltion UI revamp (needed to show to Jonny Bradley).
--- trunk/tiki-editpage.php	2010-01-23 17:22:00 UTC (rev 24622)
+++ trunk/tiki-editpage.php	2010-01-23 19:41:34 UTC (rev 24623)
// Define all templates files that may be used with the 'zoom' feature
-$zoom_templates = array('wiki_edit');
+$zoom_templates = array('wiki_edit', 'tiki-editpage');
$smarty->assign('msg', tra('This feature is disabled').': feature_wiki');
@@ -1303,7 +1303,8 @@
screwed up. Will reactivate as soon as I get the CSS right for
-//		$_REQUEST['zoom'] = 'wiki_edit';
+//		$_REQUEST['zoom'] = 'tiki-editpage';
+//		$diff_style = 'inlinediff-full';
$smarty->assign('update_translation', 'y');
Re: [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[24623]
trunk/tiki-editpage.php	From: Jonny Bradley <jonny@ti...> -	2010-01-24 19:15
Hi Alain and all
This code is the old way of doing fullscreen edit ($zoom_templates etc) and should all be ripped out. If i get enough time before the end of month freeze i will.
Full screen is all client-side JavaScript now (see toggleFullScreen() in tiki-jquery.js)
I'll add the code to automatically go to fullscreen in translation diff mode very soon (promise!).
On 23 Jan 2010, at 11:41, alain_desilets@... wrote:
> Revision: 24623
>          http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24623&view=rev
> Date:     2010-01-23 19:41:34 +0000 (Sat, 23 Jan 2010)
> Small change (uncommented for now) towards transltion UI revamp (needed to show to Jonny Bradley).
> --- trunk/tiki-editpage.php	2010-01-23 17:22:00 UTC (rev 24622)
> +++ trunk/tiki-editpage.php	2010-01-23 19:41:34 UTC (rev 24623)
> // Define all templates files that may be used with the 'zoom' feature
> -$zoom_templates = array('wiki_edit');
> +$zoom_templates = array('wiki_edit', 'tiki-editpage');
> if ($prefs['feature_wiki'] != 'y') {
> 	$smarty->assign('msg', tra('This feature is disabled').': feature_wiki');
> @@ -1303,7 +1303,8 @@
> 		   screwed up. Will reactivate as soon as I get the CSS right for
> 		   that.
> -//		$_REQUEST['zoom'] = 'wiki_edit';
> +//		$_REQUEST['zoom'] = 'tiki-editpage';
> +//		$diff_style = 'inlinediff-full';
> 		$smarty->assign('update_translation', 'y');
trunk/tiki-editpage.php	From: <sylvieg@us...> -	2010-01-25 22:47
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[24692]
trunk/tiki-editpage.php	From: <alain_desilets@us...> -	2010-01-27 02:06
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24692&view=rev
Date:     2010-01-27 02:06:13 +0000 (Wed, 27 Jan 2010)
--- trunk/tiki-editpage.php	2010-01-27 00:36:19 UTC (rev 24691)
+++ trunk/tiki-editpage.php	2010-01-27 02:06:13 UTC (rev 24692)
if( $editlib->isNewTranslationMode() ) {
-							$sourceInfo = $tikilib->get_page_info( $_REQUEST['translationOf'] );
+							$sourceInfo = $tikilib->get_page_info( $editlib->sourcePageName );
-			$infoSource = $tikilib->get_page_info($_REQUEST['translationOf']);
-			$infoCurrent = $tikilib->get_page_info($_REQUEST['page']);
+			$infoSource = $tikilib->get_page_info($editlib->sourcePageName);
+			$infoCurrent = $tikilib->get_page_info($editlib->targetPageName);
if ($multilinguallib->insertTranslation('wiki page', $infoSource['page_id'], $infoSource['lang'], $infoCurrent['page_id'], $pageLang)){
$smarty->assign('msg', tra("The language can't be changed as its set of translations has already this language"));
-				$sourceInfo = $tikilib->get_page_info( $_REQUEST['translationOf'] );
+				$sourceInfo = $tikilib->get_page_info( $editlib->sourcePageName );
$targetInfo = $tikilib->get_page_info( $_REQUEST['page'] );
-		$smarty->assign( 'translationOf', $_REQUEST['translationOf'] );
+		$smarty->assign( 'translationOf', $editlib->sourcePageName );
// Display an error if the page already exists
global $multilinguallib; include_once("lib/multilingual/multilinguallib.php");
-		$sourceInfo = $tikilib->get_page_info( $_REQUEST['translationOf'] );
+		$sourceInfo = $tikilib->get_page_info( $editlib->sourcePageName );
if( $multilinguallib->getTranslation('wiki page', $sourceInfo['page_id'], $_REQUEST['lang'] ) ) {
$smarty->assign('msg',tra("The translation set already contains a page in this language."));
-	if( $editlib->isUpdateTranslationMode() ) {
+	if( $editlib->isTranslationMode() ) {
include_once('lib/wiki/histlib.php');
histlib_helper_setup_diff( $editlib->sourcePageName, $editlib->oldSourceVersion, $editlib->newSourceVersion );
$smarty->assign( 'diff_oldver', (int) $editlib->oldSourceVersion );
$smarty->assign('taglist', $_REQUEST['freetag_string']);
} elseif( $editlib->isNewTranslationMode() ) {
-		$tags = $freetaglib->get_all_tags_on_object_for_language($_REQUEST['translationOf'], 'wiki page', $pageLang);
+		$tags = $freetaglib->get_all_tags_on_object_for_language($editlib->sourcePageName, 'wiki page', $pageLang);
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[24911]
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2010-02-07 16:47
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=24911&view=rev
Date:     2010-02-07 16:46:58 +0000 (Sun, 07 Feb 2010)
--- trunk/tiki-editpage.php	2010-02-07 16:01:56 UTC (rev 24910)
+++ trunk/tiki-editpage.php	2010-02-07 16:46:58 UTC (rev 24911)
@@ -1338,13 +1338,13 @@
if (($prefs['feature_wiki_templates'] == 'y' && $tiki_p_use_content_templates == 'y') ||
($prefs['feature_wiki_usrlock'] == 'y' && ($tiki_p_lock == 'y' || $tiki_p_admin_wiki == 'y')) ||
-	($prefs['feature_wiki_replace'] == 'y' && $wysiwyg != 'y') ||
+	($prefs['feature_wiki_replace'] == 'y' && $_SESSION['wysiwyg'] != 'y') ||
$prefs['wiki_spellcheck'] == 'y' ||
-	($prefs['feature_wiki_allowhtml'] == 'y' && $tiki_p_use_HTML == 'y' && $wysiwyg != 'y') ||
+	($prefs['feature_wiki_allowhtml'] == 'y' && $tiki_p_use_HTML == 'y' && $_SESSION['wysiwyg'] != 'y') ||
$prefs['feature_wiki_import_html'] == 'y' ||
$prefs['wiki_comments_allow_per_page'] != 'n' ||
($tiki_p_admin_wiki == 'y' && $prefs['feature_wiki_import_page'] == 'y') ||
-	($wysiwyg != 'y' && ($prefs['feature_wiki_attachments'] == 'y' && ($tiki_p_wiki_attach_files == 'y' && $tiki_p_wiki_admin_attachments == 'y')))) {
+	($_SESSION['wysiwyg'] != 'y' && ($prefs['feature_wiki_attachments'] == 'y' && ($tiki_p_wiki_attach_files == 'y' && $tiki_p_wiki_admin_attachments == 'y')))) {
$smarty->assign('showToolsTab', 'y');
if (strtolower($page) != 'sandbox' &&
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[28727]
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2010-08-26 16:12
Revision: 28727
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=28727&view=rev
Date:     2010-08-26 16:12:15 +0000 (Thu, 26 Aug 2010)
[FIX] multilingual: Only set no_bl=y on the URL if feature_multilingual (should be a $_SESSION var really imho, looks bad on the URLs)
--- trunk/tiki-editpage.php	2010-08-26 14:38:46 UTC (rev 28726)
+++ trunk/tiki-editpage.php	2010-08-26 16:12:15 UTC (rev 28727)
-	if ($prefs['feature_best_language'] === 'y' || isset($_REQUEST['save'])) {
+	if ($prefs['feature_multilingual'] === 'y' && ($prefs['feature_best_language'] === 'y' || isset($_REQUEST['save']))) {
$url .= '&no_bl=y';
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2010-09-03 19:26
[FIX] ckeditor: Parsing wysiwyg plugins preg_replace was failing on a page with corrupted plugins, so don't do the replace if there was an error.
$edit = preg_replace('/<p>!(.*)<\/p>/u', "!$1\n", $edit);
-			$edit = preg_replace('/<div[^>]*syntax="(.*)".*end cke_tiki_plugin -->/Umis', "$1", $edit);
+			// preg_replace blows up here with a PREG_BACKTRACK_LIMIT_ERROR on pages with "corrupted" plugins
+			$edit2 = preg_replace('/<div[^>]*syntax="(.*)".*end cke_tiki_plugin -->/Umis', "$1", $edit);
$tikilib->update_page($_REQUEST["page"],$edit,$_REQUEST["comment"],$user,$tikilib->get_ip_address(),$description,$minor,$pageLang, $is_html, $hash, null, $_REQUEST['wysiwyg'], $wiki_authors_style);
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[28992]
trunk/tiki-editpage.php	From: <chealer@us...> -	2010-09-07 05:33
Revision: 28992
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=28992&view=rev
Date:     2010-09-07 05:33:00 +0000 (Tue, 07 Sep 2010)
use new wikilib "bad characters" prevention methods
forgotten in r28740, oops
--- trunk/tiki-editpage.php	2010-09-07 02:43:39 UTC (rev 28991)
+++ trunk/tiki-editpage.php	2010-09-07 05:33:00 UTC (rev 28992)
@@ -1255,8 +1255,6 @@
-$page_badchars_display = ":/?#[]@!$&'()*+,;=<>";
-$page_badchars = "/[:\/?#\[\]@!$&'()*+,;=<>]/";
if ($is_staging_article && $approved = $tikilib->get_approved_page($page) ) {
$page_name = $approved;
@@ -1264,9 +1262,8 @@
$page_name = $page;
-$matches = preg_match($page_badchars, $page_name);
-if ($matches && ! $tikilib->page_exists($page) ) {
-	$smarty->assign('page_badchars_display', $page_badchars_display);
+if ($wikilib->contains_badchars($page) && ! $tikilib->page_exists($page) ) {
+	$smarty->assign('page_badchars_display', $wikilib->get_badchars());
$plugins = $wikilib->list_plugins(true, 'editwiki');
tikiwiki:[28992]	trunk/tiki-editpage.php	From: luci aka luciash d' being <sf@gr...> -	2010-09-07 14:09
> use new wikilib "bad characters" prevention methods
>  $is_staging_article = ($prefs['wikiapproval_staging_category'] > 0) && (in_array($prefs['wikiapproval_staging_category'], $cats));
> -$page_badchars_display = ":/?#[]@!$&'()*+,;=<>";
> -$page_badchars = "/[:\/?#\[\]@!$&'()*+,;=<>]/";
> -	$smarty->assign('page_badchars_display', $page_badchars_display);
> +	$smarty->assign('page_badchars_display', $wikilib->get_badchars());
>  $plugins = $wikilib->list_plugins(true, 'editwiki');
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2010-09-19 14:36
$smarty->assign('trads', $trads);
-$smarty->assign('edittimeout', ini_get('session.gc_maxlifetime'));
if (($prefs['feature_wiki_templates'] === 'y' && $tiki_p_use_content_templates === 'y') ||
($prefs['feature_wiki_usrlock'] === 'y' && ($tiki_p_lock === 'y' || $tiki_p_admin_wiki === 'y')) ||
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[29394]
trunk/tiki-editpage.php	From: <nkoth@us...> -	2010-09-20 16:20
Revision: 29394
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=29394&view=rev
Date:     2010-09-20 16:20:31 +0000 (Mon, 20 Sep 2010)
[FIX] Library errors
--- trunk/tiki-editpage.php	2010-09-20 15:40:43 UTC (rev 29393)
+++ trunk/tiki-editpage.php	2010-09-20 16:20:31 UTC (rev 29394)
-						if ( $approved = $this->get_approved_page($page) ) {
+						if ( $approved = $tikilib->get_approved_page($page) ) {
$oldpage = $approved;
$oldpageid = $tikilib->get_page_id_from_name($oldpage);
$oldtrads = $multilinguallib->getTrads('wiki page', $oldpageid);
-			$url = $wiki->sefurl($page);
+			$url = $wikilib->sefurl($page);
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[31978]
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2011-01-18 15:19
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=31978&view=rev
+		if ($tiki_p_wiki_approve == 'y' && $prefs['flaggedrev_approval'] == 'y') {
+			if ($flaggedrevisionlib->page_requires_approval($page)) {
+				$url .= '&latest=1';
+	if ($tiki_p_wiki_approve == 'y' && $prefs['flaggedrev_approval'] == 'y') {
+		if ($flaggedrevisionlib->page_requires_approval($page)) {
+			$url .= '&latest=1';
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[36476]
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2011-08-25 13:16
Revision: 36476
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=36476&view=rev
Date:     2011-08-25 13:16:32 +0000 (Thu, 25 Aug 2011)
[FIX] wysiwyg: Small html fix, many more needed...
--- trunk/tiki-editpage.php	2011-08-25 11:52:16 UTC (rev 36475)
+++ trunk/tiki-editpage.php	2011-08-25 13:16:32 UTC (rev 36476)
$info['is_html'] = true;
+			$smarty->assign('allowhtml','y');
-		$smarty->assign('allowhtml','y');
} elseif ($_SESSION['wysiwyg'] === 'y') {
if ($edit_data == 'ajax error') {
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[36692]
trunk/tiki-editpage.php	From: <mlustenberg@us...> -	2011-08-30 19:43
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=36692&view=rev
Date:     2011-08-30 19:43:06 +0000 (Tue, 30 Aug 2011)
[FIX] wysiwyg_htmltowiki: fixed editor switch from WYSIWYG Wiki to Wiki
--- trunk/tiki-editpage.php	2011-08-30 19:41:19 UTC (rev 36691)
+++ trunk/tiki-editpage.php	2011-08-30 19:43:06 UTC (rev 36692)
if (isset($_REQUEST['mode_normal']) && $_REQUEST['mode_normal'] ==='y') {
$smarty->assign('msg', "Parsing html to wiki");
-		$parsed = $editlib->parseToWiki($edit_data);
+		if ($prefs['wysiwyg_htmltowiki'] === 'n' || $info['is_html'] == 1) {
+			$parsed = $editlib->parseToWiki($edit_data); // when we come from WYSIWYG Wiki the data must not be touched
$info['is_html'] = false;
$info['wysiwyg'] = false;
trunk/tiki-editpage.php	From: <sampaioprimo@us...> -	2011-09-07 21:09
if ($editpageconflict === 'y' && !isset($_REQUEST["conflictoverride"]) ) {
include_once('lib/smarty_tiki/modifier.userlink.php');
-		$msg = tra("This page is being edited by ") .
-			smarty_modifier_userlink($semUser) . ". " .
-			tra("Please check with the user before editing the page,
-			you will have to manually merge them later. ") ;
+		$msg = tr("This page is being edited by %0. Please check with the user before editing the page,	otherwise the changes will be stored as two separate versions in the history and you will have to manually merge them later.", $semUser);
$msg .= '<br /><br /><a href="tiki-editpage.php?page=';
$msg .= '&conflictoverride=y">' . tra('Override lock and carry on with edit') . '</a>';
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[37570]
trunk/tiki-editpage.php	From: <chealer@us...> -	2011-09-23 02:50
Revision: 37570
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=37570&view=rev
Date:     2011-09-23 02:50:22 +0000 (Fri, 23 Sep 2011)
[FIX] "Undefined variable: tiki_p_wiki_approve"
--- trunk/tiki-editpage.php	2011-09-23 02:12:02 UTC (rev 37569)
+++ trunk/tiki-editpage.php	2011-09-23 02:50:22 UTC (rev 37570)
-		if ($tiki_p_wiki_approve == 'y' && $prefs['flaggedrev_approval'] == 'y') {
+		if ($prefs['flaggedrev_approval'] == 'y' && $tiki_p_wiki_approve == 'y') {
-	if ($tiki_p_wiki_approve == 'y' && $prefs['flaggedrev_approval'] == 'y') {
+	if ($prefs['flaggedrev_approval'] == 'y' && $tiki_p_wiki_approve == 'y') {
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[39160]
trunk/tiki-editpage.php	From: <chealer@us...> -	2011-12-13 04:22
Revision: 39160
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39160&view=rev
Date:     2011-12-13 04:22:04 +0000 (Tue, 13 Dec 2011)
[FIX] Wiki: Page content stored HTML-encoded in the database. Fixes HTML special characters showing as modified (and double-encoded in the original version) in differences. Ref: r1324
[REF] Group $edit code
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=1324&view=rev
--- trunk/tiki-editpage.php	2011-12-12 21:46:37 UTC (rev 39159)
+++ trunk/tiki-editpage.php	2011-12-13 04:22:04 UTC (rev 39160)
@@ -800,13 +800,7 @@
-	if ( ! isset($_REQUEST['edit']) && ! $is_html ) {
-		// When we get data from database (i.e. we are not in preview mode) and if we don't allow HTML,
-		//   then we need to convert database's HTML entities into their "normal chars" equivalents
-		$parsed = TikiLib::htmldecode($edit_data);
@@ -924,11 +918,14 @@
-	if ($is_html) {
-		$edit = $_REQUEST["edit"];
-		$edit = htmlspecialchars($_REQUEST['edit']);
+	$edit = $_REQUEST["edit"];
+	$parserlib = TikiLib::lib('parser');
+	$edit = $parserlib->apply_postedit_handlers($edit);
isset($prefs['wiki_feature_copyrights'])
@@ -948,11 +945,6 @@
$copyrightslib->add_copyright($page, $copyrightTitle, $copyrightYear, $copyrightAuthors, $user);
-	// Parse $edit and eliminate image references to external URIs (make them internal)
-	$edit = $imagegallib->capture_images($edit);
-	// apply the optional page edit filters before data storage
-	$parserlib = TikiLib::lib('parser');
-	$edit = $parserlib->apply_postedit_handlers($edit);
Re: [Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[39160]
trunk/tiki-editpage.php	From: Filipus Klutiero <chealer@gm...> -	2011-12-13 04:37
Le 2011-12-12 23:22, chealer@... a écrit :
> Revision: 39160
>            http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39160&view=rev
> Date:     2011-12-13 04:22:04 +0000 (Tue, 13 Dec 2011)
> [FIX] Wiki: Page content stored HTML-encoded in the database. Fixes HTML special characters showing as modified (and double-encoded in the original version) in differences. Ref: r1324
> [REF] Group $edit code
>      http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=1324&view=rev
>      trunk/tiki-editpage.php
> --- trunk/tiki-editpage.php	2011-12-12 21:46:37 UTC (rev 39159)
> +++ trunk/tiki-editpage.php	2011-12-13 04:22:04 UTC (rev 39160)
> @@ -800,13 +800,7 @@
>   if (empty($parsed)) {
> -	if ( ! isset($_REQUEST['edit'])&&  ! $is_html ) {
> -		// When we get data from database (i.e. we are not in preview mode) and if we don't allow HTML,
> -		//   then we need to convert database's HTML entities into their "normal chars" equivalents
> -		$parsed = TikiLib::htmldecode($edit_data);
>   		$parsed = $edit_data;
>   $smarty->assign('pagedata', $parsed);
> @@ -924,11 +918,14 @@
>   	include_once("poll_categorize.php");
>   	include_once("freetag_apply.php");
>   	$page = $_REQUEST["page"];
> -	if ($is_html) {
> -		$edit = $_REQUEST["edit"];
> -		$edit = htmlspecialchars($_REQUEST['edit']);
> +	$edit = $_REQUEST["edit"];
> +	// Parse $edit and eliminate image references to external URIs (make them internal)
> +	$edit = $imagegallib->capture_images($edit);
> +	// apply the optional page edit filters before data storage
> +	$parserlib = TikiLib::lib('parser');
> +	$edit = $parserlib->apply_postedit_handlers($edit);
>   	// add permisions here otherwise return error!
>   	if (
>   		isset($prefs['wiki_feature_copyrights'])
> @@ -948,11 +945,6 @@
>   		$copyrightslib->add_copyright($page, $copyrightTitle, $copyrightYear, $copyrightAuthors, $user);
> -	// Parse $edit and eliminate image references to external URIs (make them internal)
> -	$edit = $imagegallib->capture_images($edit);
> -	// apply the optional page edit filters before data storage
> -	$parserlib = TikiLib::lib('parser');
> -	$edit = $parserlib->apply_postedit_handlers($edit);
>   	$exist = $tikilib->page_exists($_REQUEST['page']);
>   	// If page exists
>   	if (!$exist) {
I forgot that this will need a conversion as this effectively changes
the database schema's semantics. I will work on that tomorrow.
trunk/tiki-editpage.php	From: Marc Laporte <marc@ma...> -	2011-12-13 05:26
And for people to understand what this is about:   The bug was having
a lot of false positives in the diffs, making collaboration less fluid
On Mon, Dec 12, 2011 at 11:37 PM, Filipus Klutiero <chealer@...> wrote:
> Le 2011-12-12 23:22, chealer@... a écrit :
>> Revision: 39160
>>            http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39160&view=rev
>> Date:     2011-12-13 04:22:04 +0000 (Tue, 13 Dec 2011)
>> [FIX] Wiki: Page content stored HTML-encoded in the database. Fixes HTML special characters showing as modified (and double-encoded in the original version) in differences. Ref: r1324
>> [REF] Group $edit code
>>      http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=1324&view=rev
>>      trunk/tiki-editpage.php
>> --- trunk/tiki-editpage.php   2011-12-12 21:46:37 UTC (rev 39159)
>> +++ trunk/tiki-editpage.php   2011-12-13 04:22:04 UTC (rev 39160)
>>   if (empty($parsed)) {
>> -     if ( ! isset($_REQUEST['edit'])&&  ! $is_html ) {
>> -             // When we get data from database (i.e. we are not in preview mode) and if we don't allow HTML,
>> -             //   then we need to convert database's HTML entities into their "normal chars" equivalents
>> -             $parsed = TikiLib::htmldecode($edit_data);
>> -     } else {
>>               $parsed = $edit_data;
>>   $smarty->assign('pagedata', $parsed);
>> @@ -924,11 +918,14 @@
>>       include_once("poll_categorize.php");
>>       include_once("freetag_apply.php");
>>       $page = $_REQUEST["page"];
>> -     if ($is_html) {
>> -             $edit = $_REQUEST["edit"];
>> -             $edit = htmlspecialchars($_REQUEST['edit']);
>> +     $edit = $_REQUEST["edit"];
>> +     // Parse $edit and eliminate image references to external URIs (make them internal)
>> +     $edit = $imagegallib->capture_images($edit);
>> +     // apply the optional page edit filters before data storage
>> +     $parserlib = TikiLib::lib('parser');
>> +     $edit = $parserlib->apply_postedit_handlers($edit);
>>       // add permisions here otherwise return error!
>>       if (
>>               isset($prefs['wiki_feature_copyrights'])
>> @@ -948,11 +945,6 @@
>>               $copyrightslib->add_copyright($page, $copyrightTitle, $copyrightYear, $copyrightAuthors, $user);
>> -     // Parse $edit and eliminate image references to external URIs (make them internal)
>> -     $edit = $imagegallib->capture_images($edit);
>> -     // apply the optional page edit filters before data storage
>> -     $parserlib = TikiLib::lib('parser');
>> -     $edit = $parserlib->apply_postedit_handlers($edit);
>>       $exist = $tikilib->page_exists($_REQUEST['page']);
>>       // If page exists
>>       if (!$exist) {
> I forgot that this will need a conversion as this effectively changes
> the database schema's semantics. I will work on that tomorrow.
trunk/tiki-editpage.php	From: <arildb@us...> -	2012-01-22 05:27
-	if (!empty($_REQUEST['returnto'])) {	// came from wikiplugin_include.php edit button
-		$url = "location:".$wikilib->sefurl($_REQUEST['returnto']);
+	if (!empty($_REQUEST['returnto'])) {
+		if(isURL($_REQUEST['returnto'])) {
+			$url = "location:".$_REQUEST['returnto'];
+			$url = "location:".$wikilib->sefurl($_REQUEST['returnto']);
if (!empty($_REQUEST['returnto'])) {	// came from wikiplugin_include.php edit button
-		$url = $wikilib->sefurl($_REQUEST['returnto']);
+			$url = $_REQUEST['returnto'];
+			$url = $wikilib->sefurl($_REQUEST['returnto']);
$smarty->assign('qtcycle', '');
$smarty->display("tiki.tpl");
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[39685]
trunk/tiki-editpage.php	From: <sylvieg@us...> -	2012-01-26 22:44
Revision: 39685
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39685&view=rev
Date:     2012-01-26 22:44:27 +0000 (Thu, 26 Jan 2012)
[merge/r39683][FIX]wiki: wiki_watch_author back
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=39683&view=rev
--- trunk/tiki-editpage.php	2012-01-26 22:42:56 UTC (rev 39684)
+++ trunk/tiki-editpage.php	2012-01-26 22:44:27 UTC (rev 39685)
$isFormSubmit = isset($jitRequest['edit']);
if ( $tikilib->page_exists($page) ) {
$currentlyWatching = (bool) $tikilib->user_watches($user, 'wiki_page_changed', $page, 'wiki page');
+		$default = $currentlyWatching;
// New pages get default watch checked for authors
-		$currentlyWatching = ($prefs['wiki_watch_author'] === 'y');
+		$currentlyWatching = false;
+		$default = ($prefs['wiki_watch_author'] === 'y');
$requestedWatch = isset($_REQUEST['watch']) && $isFormSubmit;
$smarty->assign('show_watch', 'y');
-	$smarty->assign('watch_checked', ( ($currentlyWatching && !$isFormSubmit) || $requestedWatch) ? 'y' : 'n');
+	$smarty->assign('watch_checked', ( ($default && !$isFormSubmit) || $requestedWatch) ? 'y' : 'n');
$currentlyWatching = false;
$requestedWatch = false;
trunk/tiki-editpage.php	From: <arildb@us...> -	2012-10-18 11:55
+if ($prefs['namespace_enabled'] === 'y') {
+	$s_page_info = $structlib->s_get_page_info($_REQUEST['current_page_id']);
+	$s_suffix = '';
+	if (isset($prefs['namespace_separator']) && !empty($prefs['namespace_separator']) && strpos($s_page_info['pageName'], $prefs['namespace_separator'])!==false) {
+		$split = explode($prefs['namespace_separator'], $s_page_info['pageName']);
+	$_REQUEST['namespace'] = $s_suffix;
if ($prefs['namespace_enabled'] == 'y' && isset($_REQUEST['namespace'])) {
$page = $_REQUEST['namespace'] . $prefs['namespace_separator'] . $page;
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[43963]
trunk/tiki-editpage.php	From: <robertplummer@us...> -	2012-11-15 14:48
Revision: 43963
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=43963&view=rev
Date:     2012-11-15 14:48:47 +0000 (Thu, 15 Nov 2012)
[ENH] Use jison html parser/handler to turn html back into wiki syntax
--- trunk/tiki-editpage.php	2012-11-15 14:47:38 UTC (rev 43962)
+++ trunk/tiki-editpage.php	2012-11-15 14:48:47 UTC (rev 43963)
@@ -1138,7 +1138,10 @@
-		if ($_SESSION['wysiwyg'] === 'y' && $prefs['wysiwyg_wiki_parsed'] === 'y' && $prefs['wysiwyg_ckeditor'] === 'y') {
+		if ($prefs['feature_jison_wiki_parser'] == 'y' && $prefs['wysiwyg_ckeditor'] === 'y') {
+			$edit = $parser->parse($edit);
+		} else if ($_SESSION['wysiwyg'] === 'y' && $prefs['wysiwyg_wiki_parsed'] === 'y' && $prefs['wysiwyg_ckeditor'] === 'y') {
$edit = $editlib->partialParseWysiwygToWiki($edit);
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[44039]
trunk/tiki-editpage.php	From: <robertplummer@us...> -	2012-11-19 21:13
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=44039&view=rev
Date:     2012-11-19 21:13:12 +0000 (Mon, 19 Nov 2012)
[FIX] Correction on pref name
--- trunk/tiki-editpage.php	2012-11-19 21:12:36 UTC (rev 44038)
+++ trunk/tiki-editpage.php	2012-11-19 21:13:12 UTC (rev 44039)
-		if ($prefs['feature_jison_wiki_parser'] == 'y' && $prefs['wysiwyg_ckeditor'] === 'y') {
+		if ($prefs['feature_jison_wiki_parser'] == 'y' && $prefs['feature_wysiwyg'] === 'y') {
$edit = $parser->parse($edit);
} else if ($_SESSION['wysiwyg'] === 'y' && $prefs['wysiwyg_wiki_parsed'] === 'y' && $prefs['wysiwyg_ckeditor'] === 'y') {
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[44043]
trunk/tiki-editpage.php	From: <robertplummer@us...> -	2012-11-19 21:43
Revision: 44043
http://tikiwiki.svn.sourceforge.net/tikiwiki/?rev=44043&view=rev
Date:     2012-11-19 21:43:36 +0000 (Mon, 19 Nov 2012)
[FIX] ensure wysiwyg only parses when session is set
--- trunk/tiki-editpage.php	2012-11-19 21:18:56 UTC (rev 44042)
+++ trunk/tiki-editpage.php	2012-11-19 21:43:36 UTC (rev 44043)
-		if ($prefs['feature_jison_wiki_parser'] == 'y' && $prefs['feature_wysiwyg'] === 'y') {
+		if ($_SESSION['wysiwyg'] === 'y' && $prefs['feature_jison_wiki_parser'] == 'y' && $prefs['feature_wysiwyg'] === 'y') {
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[44114]
trunk/tiki-editpage.php	From: <arildb@us...> -	2012-11-28 19:27
-	$s_page_info = $structlib->s_get_page_info($_REQUEST['current_page_id']);
-	$s_suffix = '';
-	if (isset($prefs['namespace_separator']) && !empty($prefs['namespace_separator']) && strpos($s_page_info['pageName'], $prefs['namespace_separator'])!==false) {
-		$split = explode($prefs['namespace_separator'], $s_page_info['pageName']);
+	if (isset($_REQUEST['current_page_id'])) {
+		$s_page_info = $structlib->s_get_page_info($_REQUEST['current_page_id']);
+		$s_suffix = '';
+		if (isset($prefs['namespace_separator']) && !empty($prefs['namespace_separator']) && strpos($s_page_info['pageName'], $prefs['namespace_separator'])!==false) {
+			$split = explode($prefs['namespace_separator'], $s_page_info['pageName']);
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[44938]
trunk/tiki-editpage.php	From: <arildb@us...> -	2013-02-21 14:18
Revision: 44938
Date:     2013-02-21 14:18:24 +0000 (Thu, 21 Feb 2013)
[FIX] Only prepend the namespace indicator, if the page is missing a namespace
--- trunk/tiki-editpage.php	2013-02-21 10:20:18 UTC (rev 44937)
+++ trunk/tiki-editpage.php	2013-02-21 14:18:24 UTC (rev 44938)
-	$page = $_REQUEST['namespace'] . $prefs['namespace_separator'] . $page;
+	$ns = $_REQUEST['namespace'] . $prefs['namespace_separator'];
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[44940]
trunk/tiki-editpage.php	From: <arildb@us...> -	2013-02-21 15:16
Revision: 44940
http://sourceforge.net/p/tikiwiki/code/44940
Date:     2013-02-21 15:16:32 +0000 (Thu, 21 Feb 2013)
--- trunk/tiki-editpage.php	2013-02-21 14:24:13 UTC (rev 44939)
+++ trunk/tiki-editpage.php	2013-02-21 15:16:32 UTC (rev 44940)
-	// Only prepend the namespace separator, if the page is missing a namespace
-	$ns = $_REQUEST['namespace'] . $prefs['namespace_separator'];
-	if (strpos($page, $ns, 0) === false) {
-		$page = $ns . $page;
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[45072]
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2013-03-06 17:27
http://sourceforge.net/p/tikiwiki/code/45072
Date:     2013-03-06 17:27:06 +0000 (Wed, 06 Mar 2013)
[FIX] editpage: Don't add a second ? in the URL for conflictoverride (var $url not set previously)
--- trunk/tiki-editpage.php	2013-03-06 17:25:56 UTC (rev 45071)
+++ trunk/tiki-editpage.php	2013-03-06 17:27:06 UTC (rev 45072)
$msg = tr("This page is being edited by %0. Please check with the user before editing the page,	otherwise the changes will be stored as two separate versions in the history and you will have to manually merge them later.", $semUser);
-		$msg .= (strpos('?', $url) === false ? '?' : '&') . 'conflictoverride=y">' . tra('Override lock and carry on with edit') . '</a>';
+		$msg .= '&conflictoverride=y">' . tra('Override lock and carry on with edit') . '</a>';
$smarty->assign('msg', $msg);
$smarty->assign('errortitle', tra('Page is currently being edited'));
trunk/tiki-editpage.php	From: <lphuberdeau@us...> -	2013-03-21 14:53
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[45437]
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2013-04-10 16:28
http://sourceforge.net/p/tikiwiki/code/45437
Date:     2013-04-10 16:28:11 +0000 (Wed, 10 Apr 2013)
[FIX] wysiwyg: Check page's is_html setting rather than the pref when parsing edit data
--- trunk/tiki-editpage.php	2013-04-10 15:33:11 UTC (rev 45436)
+++ trunk/tiki-editpage.php	2013-04-10 16:28:11 UTC (rev 45437)
+		if (empty($info['is_html'])) {
unset($_REQUEST['save']);	// don't save an ajax error
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[47039]
trunk/tiki-editpage.php	From: <arildb@us...> -	2013-08-09 13:07
Revision: 47039
http://sourceforge.net/p/tikiwiki/code/47039
Date:     2013-08-09 13:07:56 +0000 (Fri, 09 Aug 2013)
[FIX] Cut long page names to 154 characters, which is the max usable length.
See comments in code for more.
--- trunk/tiki-editpage.php	2013-08-09 12:54:49 UTC (rev 47038)
+++ trunk/tiki-editpage.php	2013-08-09 13:07:56 UTC (rev 47039)
+// The max pagename length is 160 characters ( tiki_pages.pageName varchar(160) ).
+//	However, wiki_rename_page stores a page in the format: $tmpName = "TmP".$newName."TmP";
+//	So, actual max page name length is 160 - 6 = 154
+//	Strip excess characters (silently) and proceed.
+//	Notes: The pagename length is pretty short. Maybe 255 chars would be better?
+//	Changing it also involves changing/checking other tables, e.g. tiki_history and tiki_objects. arildb
+$max_pagename_length = 154;
+if(strlen($_REQUEST["page"]) > $max_pagename_length) {
+	$_REQUEST["page"] = substr($_REQUEST["page"], 0, $max_pagename_length);
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[47237]
trunk/tiki-editpage.php	From: <arildb@us...> -	2013-08-23 17:48
Revision: 47237
http://sourceforge.net/p/tikiwiki/code/47237
Date:     2013-08-23 17:48:29 +0000 (Fri, 23 Aug 2013)
[FIX] HTML syntax in wiki pages could occur with inline editing
--- trunk/tiki-editpage.php	2013-08-23 16:45:51 UTC (rev 47236)
+++ trunk/tiki-editpage.php	2013-08-23 17:48:29 UTC (rev 47237)
+// If using the wiki text editor, set the (output) page format to non-html.
+if ($_SESSION['wysiwyg'] === 'n') {
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[47270]
trunk/tiki-editpage.php	From: <jonnybradley@us...> -	2013-08-24 19:17
Revision: 47270
http://sourceforge.net/p/tikiwiki/code/47270
Date:     2013-08-24 19:17:03 +0000 (Sat, 24 Aug 2013)
[FIX] html: Use allowhtml sent in request if set - prevents former html wysiwyg pages ending up as html ones (thanks arildb)
--- trunk/tiki-editpage.php	2013-08-24 18:19:15 UTC (rev 47269)
+++ trunk/tiki-editpage.php	2013-08-24 19:17:03 UTC (rev 47270)
$pageLang,
-			$is_html,
+			isset($_REQUEST['allowhtml']) ? $_REQUEST['allowhtml'] : $is_html,
$_REQUEST['wysiwyg'],
[Tikiwiki-cvs/svn] SF.net SVN: tikiwiki:[47271]
trunk/tiki-editpage.php	From: <arildb@us...> -	2013-08-24 19:40
Revision: 47271
http://sourceforge.net/p/tikiwiki/code/47271
Date:     2013-08-24 19:40:08 +0000 (Sat, 24 Aug 2013)
[ROLLBACK][r47237[FIX] HTML syntax in wiki pages could occur with inline editing.
Fixed in a better way by r47270. thanks jonnyb
--- trunk/tiki-editpage.php	2013-08-24 19:17:03 UTC (rev 47270)
+++ trunk/tiki-editpage.php	2013-08-24 19:40:08 UTC (rev 47271)
@@ -953,12 +953,6 @@
-// If using the wiki text editor, set the (output) page format to non-html.
-if ($_SESSION['wysiwyg'] === 'n') {
-	$is_html = false;

value: This website is a web service that offers software consumers a centralized online location to control and manage open-source software projects and research business software. It provides source code repository hosting, bug tracking, mirroring of downloads for load balancing, a wiki for documentation, developer and user mailing lists, user-support forums, user-written reviews and ratings, a news bulletin, micro-blog for publishing project updates, and other features.


text:
Unique Loom Mykonos Solaris Round Rug - 8' 0 x 8' 0 - Free Shipping Today - Overstock.com - 26900027
ITEM# 26900027
ITEM#: 26900027
Colors included in this rug are Multi, Beige, Blue, Gold, Orange, and Navy Blue
Model Number 3141827

type: global

value: This website is an American internet retailer selling primarily furniture headquartered in Midvale, Utah, near Salt Lake City.


text:
Close to shops and a good gym facility fitness... - Review of Century Hotel Angeles City - TripAdvisor
“Nice hotel ,staff even better they took care of...”
“Applaud to ralph at the door and Allan at the front desk”
“Breakfast are good, staffs are helpful
“Upon entering the room I found that it was small...”
“The Century is immediately behind the Casino so...”
“For an indoor pool, it is Dirty i wouldn't let...”
“The room we stayed on smelled like wet carpet...”
Close to shops and a good gym facility fitness... - Review of Century Hotel Angeles City
“sbb1417”
and 10 more sites! Century Hotel Angeles City Hotel
See the most recent reviews sbb1417
1 review 1 helpful vote “sbb1417”
Agree with deeen's comments in previous review. Can recommend this property highly. Staff, service, meals - were all of a high standard. Plus the location means you can walk to the restaurants and bars 5 mins away. Close to shops and a good gym facility (fitness connection). Would definitely stay there again.
Thank sbb1417 Report Ask sbb1417 about Century Hotel Angeles City
Chinese (Traditional) first English first French first Italian first Japanese first Korean first Russian first Any deeen
15 helpful votes “Reasonable hotel, good location, great staff!”
Thank deeen Report Ask deeen about Century Hotel Angeles City
Level 2 Contributor 6 reviews 7 helpful votes “One of the best in the area, but still needs some work”
Thank mattman808 Report Ask mattman808 about Century Hotel Angeles City
This review is the subjective opinion of a TripAdvisor member and not of TripAdvisor LLC. lwn320
3 helpful votes “Good Hotel tucked away behind Casino”
Stayed at the hotel in early August, and even though it was ok. I wont go back there again. The hotel is located behind a casino, an ideal location if you like to gamble. The bars and resturaunts on fields avenue are only a short walk away.My checkin was smooth and without hassle, I always book hotels online and have never had a problem checking in. I was shown to my room which was on the ground floor in the new wing of the hotel. The room decor was attractive, the flat screen TV worked well and the bathroom was huge with ample hot water, so there was no complaints.I did have a problem when it came to using the WiFi connection, I was provided with a password and there was no problem connecting, it justnt wouldnt work, the only place I could get an internet connection was in the reception area of the hotel. The hotel provides breakfast, this was adequate however it lacked variety, I was there 3 days and breakfast was the same each day.There was nothing wrong with the hotel and you can see from my rating ( I rated it highly), there was just something about it that i found unattractive, it might have been the ambiance, the location, the fact that it was located behind a casino I dont know. You make up your own mind.
Thank lwn320 Report Ask lwn320 about Century Hotel Angeles City
Thank cassie d Report Ask cassie d about Century Hotel Angeles City
This review is the subjective opinion of a TripAdvisor member and not of TripAdvisor LLC. RandUSA
I extended my stay here 2 times after the initial reservation. My room was nice and looked newly renovated. Everything was comfortable. There is a nice flat screen TV in the rooms, modern safe and refrigerator. I had a great housekeeper who really took care of me including making sure my laundry was done quickly. The bellman were always there if you needed something. They asked me many times if I needed anything. The manager Allan really seemed to care about your comfort. The only downside for me was my room window did not have a view and soundproofing is minimal. The great service from the employees made up for that. Overall I like this hotel and would definitely stay there again.
Thank RandUSA Report Ask RandUSA about Century Hotel Angeles City
This review is the subjective opinion of a TripAdvisor member and not of TripAdvisor LLC. RandUSA has 2 more reviews of Century Hotel Angeles City “Great hotel with excellent staff”
“Excellent location....great service from staff”
19 helpful votes “Very Nice Stay at Century Resort Hotel.”
My check-in was fast and door / front desk personnel were very friendly. My superior room had been renovated - the decor was very cozy. The room had very nice up to date furniture, comfortable bed and the shower worked very well “Hot Water with good pressure.” Friendly Housekeeping - kept my room clean. Free room WIFI was fast – better than my other hotel stay in Manila. Free Breakfast was Asian style; which was OK for me. Hotel located a few blocks from the Bar scene and noise, which made for an interest walks to / from the Walking Street area; 2 min walk.GREAT Deal for the Money, Excellent Service; would stay again and recommend to friends.
Thank Gill_2007 Report Ask Gill_2007 about Century Hotel Angeles City
#7 of 70 in Angeles City 135 reviews
#2 of 70 in Angeles City 551 reviews
#14 of 70 in Angeles City 251 reviews
#9 of 70 in Angeles City 199 reviews
TripAdvisor is proud to partner with Booking.com, Orbitz, Expedia, Hotels.com, Agoda, Priceline, TripOnline SA, Hotwire, Travelocity, HotelQuickly, getaroom.com and Travel Book Philippines, Inc. so you can book your Century Hotel Angeles City reservations with confidence. We help millions of travelers each month to find the perfect hotel for both vacation and business trips, always with the best discounts and special offers.
Explore similar hotels Central Park Tower Resort135 ReviewsShow Prices 0.3 miles Red Planet Angeles City551 ReviewsShow Prices 1.3 miles Pacific Breeze Hotel & Resort251 ReviewsShow Prices 0.3 miles See all Angeles City hotels Browse nearby

value: This website is an American online travel company that operates a website and mobile app with user-generated content and a comparison shopping website.


text:
c# - Excel 2007: XML: choking on missing ss: namespace qualifier - Stack Overflow
Excel 2007: XML: choking on missing ss: namespace qualifier
Trying to create an Excel 2007 XML file, using C# and System.XML.Serialization. The root element of an Excel XML file is such:
<Workbook xmlns:html="http://www.w3.org/TR/REC-html40" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="urn:schemas-microsoft-com:office:spreadsheet">
Many elements within the default namespace, have attributes qualified with 'ss', which is unnecessary as both 'ss' and the default namespace are both "urn:schemas-microsoft-com:office:spreadsheet".
For example the Style element, appears as:
When I create my XmlSerializerNamespaces, I add all the namespaces, that Excel wants:
ns.Add("", "urn:schemas-microsoft-com:office:spreadsheet");
ns.Add("o", "urn:schemas-microsoft-com:office:office");
ns.Add("x", "urn:schemas-microsoft-com:office:excel");
ns.Add("ss", "urn:schemas-microsoft-com:office:spreadsheet");
ns.Add("html", "http://www.w3.org/TR/REC-html40");
In the generated XML, the "" (default) namespace is omitted because it is the same as 'ss'.
My style object is something along the lines of:
[XmlRoot(Namespace = "urn:schemas-microsoft-com:office:spreadsheet")]
When I actually generate the XML I am getting:
<ss:Style ID="s21">
<ss:Font x:Family="Swiss" Bold="1"/>
I don't think there is anything technically wrong with this. Excel doesn't mind the ss: qualifier on the elements, but it chokes because it can't the 'ID' attribute of Style. It must be hardcoded to look for the literal string 'ss:ID'? If I omit the 'ss' from the namespaces it produces cleaner XML, but does not make my error go away. I have also tried omitting the 'ss' namespace, and then setting the namespace of the Style object to be literally 'ss', but it generates some temporary namespace named 'd4p1' and makes a real mess.
Any ideas on how to make Excel read valid XML?
And for bonus marks, how can I make the begginning of my XML file look like this:
Obviously the first part comes with an XML writer, but is there any non-hackish ways to get that second line?
c# xml excel xml-namespaces share|improve this question edited Apr 1 '11 at 7:30
asked Apr 1 '11 at 0:18
Rather than writing the xml yourself, did you consider using the Open XML SDK 2.0 for Microsoft Office? Besides helping with the manipulation of Open XML docs, it also contains quite a bit of documentation, and seems like it would be well suited for your task:
The Open XML SDK 2.0 for Microsoft Office is built on top of the
System.IO.Packaging API and provides
strongly typed part classes to
manipulate Open XML documents. The SDK
also uses the .NET Framework
technology to provide strongly typed
object access to the XML content
inside the parts of Open XML
I don't have a lot of faith in MS technologies working together, nor their ability to figure out XML right now, but I'll give it a try anyway. Thanks for the suggestion.
This worked, but the SDK is pretty low level, and not nearly as convenient as the package I had written.
Not the answer you're looking for?	Browse other questions tagged c# xml excel xml-namespaces or ask your own question.	asked
trying to set page margins in excel through xml
Generating namespaced XML
XML namespaces in Excel
Handle XML with and without a Default Namespace
Complicated XML with namespace for beginner
Linq XML with multiple namespace will not

value: This website is a question and answer website for professional and enthusiast programmers. It is the flagship site of the Stack Exchange Network, created in 2008 by Jeff Atwood and Joel Spolsky.


text:
Shop Mcs Jewelry Inc 14 KARAT TWO TONE, YELLOW GOLD AND WHITE GOLD, MUSICAL NOTES PENDANT NECKLACE (17 INCHES) - Multi - Free Shipping Today - Overstock.com - 14678499
Mcs Jewelry Inc 14 KARAT TWO TONE, YELLOW GOLD AND WHITE GOLD, MUSICAL NOTES PENDANT NECKLACE (17 INCHES) - Multi
ITEM# 21212792
ITEM#: 21212792
14K Yellow & White Gold Musical Notes Pendant Necklace
IMAGES ARE ENLARGED FOR A BETTER VIEW AND ARE NOT THE ACTUAL SIZE..REFER ABOVE TO THE PRODUCT SPECIFICATIONS COLUMN FOR ITEM MEASUREMENTS


text:
Get an overview of this hotelFurore bed & breakfast in Fiordo di Furore with free breakfast Location
The bed & breakfast offers a snack bar/deli. Guests can enjoy a complimentary breakfast each morning. High-speed wireless Internet access is complimentary. For a surcharge, the property provides a roundtrip airport shuttle (available on request) and a train station pick-up service. This Furore bed & breakfast also offers tour/ticket assistance, multilingual staff, and a garden. Onsite self parking is complimentary. Train station pickup (surcharge) Babysitting or childcare (surcharge) Total number of rooms - 5 Number of floors - 2 Free breakfast Airport transportation (surcharge) Tours/ticket assistance Free WiFi Multilingual staff Garden Free parking nearby Free self parking Number of buildings/towers - 1 Coffee/tea in common areas Snack bar/deli Show all bed and breakfast amenities

value: This website is an online travel agency owned by Expedia Group, an American online travel shopping company based in Seattle.


text:
You will receive 1 yard of Large Girl Dots by Riley Blake Fabrics
Blue 1930's Dots by Riley Blake Designs 112cm (w) x 25cm
Red 1930's Dots by Riley Blake Designs 112cm (w) x 25cm
Yellow 1930's Dots by Riley Blake Designs 112cm (w) x 25cm
SALE 1/2 yard Le Creme Medium Dots from Riley Blake Lime Green
Fabric patchwork dots by Riley Blake The Sweetest thing
large boy dot
navy red orange grey

value: This website is an American e-commerce company focused on handmade or vintage items and craft supplies.