Commit 8b153f32 authored by Kjartan's avatar Kjartan

- filter changes part 1. Part 2 tomorrow.

parent 72f33dde
......@@ -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);
}
......
......@@ -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 {
/*
......
......@@ -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 {
/*
......
......@@ -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) {
......
......@@ -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) {
......
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