- filter changes part 1. Part 2 tomorrow.

4.0.x
Kjartan Mannes 2002-05-03 20:27:53 +00:00
parent 72f33dde32
commit 8b153f32f4
5 changed files with 12 additions and 12 deletions

View File

@ -581,7 +581,7 @@ function format_url($address, $description = 0) {
}
function format_tag($link, $text) {
return l(('$text' ? '$text' : '$link'), array("title" => urlencode('$link')));
return l(($text ? $text : $link), array("title" => $link));
}
function form($form, $method = "post", $action = 0, $options = 0) {
@ -639,7 +639,7 @@ function form_submit($value) {
function drupal_url($args = array(), $script = "node") {
$t = array();
foreach ($args as $key => $value) {
$t[] = "$key=$value";
$t[] = "$key=". urlencode($value);
}
return "$script.php?". implode("&", $t);
}

View File

@ -46,7 +46,7 @@ function blog_save($op, $node) {
if ($op == "create") {
if (user_access("administer nodes")) {
return array();
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
}
else {
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
@ -64,7 +64,7 @@ function blog_save($op, $node) {
** pages, they will not be changed unless explicitly specified.
*/
return array();
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
}
else {
/*

View File

@ -46,7 +46,7 @@ function blog_save($op, $node) {
if ($op == "create") {
if (user_access("administer nodes")) {
return array();
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
}
else {
return array("body" => filter($node->body), "promote" => 0, "moderate" => 1, "status" => 1, "teaser" => filter($node->teaser));
@ -64,7 +64,7 @@ function blog_save($op, $node) {
** pages, they will not be changed unless explicitly specified.
*/
return array();
return array("body" => filter($node->body), "teaser" => filter($node->teaser));
}
else {
/*

View File

@ -307,9 +307,9 @@ function node_filter_html($text) {
}
function node_filter_link($text) {
$src = array("/\[\[(([^\|]*?)(\|([^\|]*?))?)\]\]/e"); // [link|description]
$dst = array(format_tag('\\2', '\\4')); // [link|description]
return preg_replace($src, $dst, $text);
$src = '\[{2}([^\|]+)(\|([^\|]+)?)?\]{2}'; // [link|description]
$dst = str_replace('%5C1', '\\1', format_tag('\\1', '\\3')); // [link|description]
return ereg_replace($src, $dst, $text);
}
function node_filter_line($text) {

View File

@ -307,9 +307,9 @@ function node_filter_html($text) {
}
function node_filter_link($text) {
$src = array("/\[\[(([^\|]*?)(\|([^\|]*?))?)\]\]/e"); // [link|description]
$dst = array(format_tag('\\2', '\\4')); // [link|description]
return preg_replace($src, $dst, $text);
$src = '\[{2}([^\|]+)(\|([^\|]+)?)?\]{2}'; // [link|description]
$dst = str_replace('%5C1', '\\1', format_tag('\\1', '\\3')); // [link|description]
return ereg_replace($src, $dst, $text);
}
function node_filter_line($text) {