summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/htmloutputter.php20
-rw-r--r--lib/subs.php6
2 files changed, 25 insertions, 1 deletions
diff --git a/lib/htmloutputter.php b/lib/htmloutputter.php
index a7c596917..a0066594f 100644
--- a/lib/htmloutputter.php
+++ b/lib/htmloutputter.php
@@ -364,6 +364,25 @@ class HTMLOutputter extends XMLOutputter
}
/**
+ * output a script (almost always javascript) tag with inline
+ * code.
+ *
+ * @param string $code relative or absolute script path
+ * @param string $type 'type' attribute value of the tag
+ *
+ * @return void
+ */
+
+ function inlineScript($code, $type='text/javascript')
+ {
+ $this->elementStart('script', array('type' => $type));
+ $this->raw('/*<![CDATA[*/ '); // XHTML compat for Safari
+ $this->raw($code);
+ $this->raw(' /*]]>*/'); // XHTML compat for Safari
+ $this->elementEnd('script');
+ }
+
+ /**
* output a css link
*
* @param string $src relative path within the theme directory, or an absolute path
@@ -420,7 +439,6 @@ class HTMLOutputter extends XMLOutputter
}
}
-
/**
* Internal script to autofocus the given element on page onload.
*
diff --git a/lib/subs.php b/lib/subs.php
index 2fc3160de..4b6b03967 100644
--- a/lib/subs.php
+++ b/lib/subs.php
@@ -127,6 +127,12 @@ function subs_unsubscribe_to($user, $other)
if (!$user->isSubscribed($other))
return _('Not subscribed!');
+ // Don't allow deleting self subs
+
+ if ($user->id == $other->id) {
+ return _('Couldn\'t delete self-subscription.');
+ }
+
$sub = DB_DataObject::factory('subscription');
$sub->subscriber = $user->id;