<commit_before><?php
	class Link extends Feathers implements Feather {
		public function __construct() {
			$this->setField(array("attr" => "source",
			                      "type" => "text",
			                      "label" => __("URL", "link"),
			                      "bookmarklet" => "url"));
			$this->setField(array("attr" => "name",
			                      "type" => "text",
			                      "label" => __("Name", "link"),
			                      "bookmarklet" => "title"));
			$this->setField(array("attr" => "description",
			                      "type" => "text_block",
			                      "label" => __("Description", "link"),
			                      "optional" => true,
			                      "preview" => true,
			                      "bookmarklet" => "selection"));

			$this->setFilter("description", "markup_post_text");
			$this->respondTo("feed_url", "set_feed_url");
		}
		public function submit() {
			if (empty($_POST['source']))
				error(__("Error"), __("URL can't be empty."));

			if (!@parse_url($_POST['source'], PHP_URL_SCHEME))
				$_POST['source'] = "http://".$_POST['source'];

			fallback($_POST['slug'], sanitize($_POST['name']));

			return Post::add(array("name" => $_POST['name'],
			                        "source" => $_POST['source'],
			                        "description" => $_POST['description']),
			                 $_POST['slug'],
			                 Post::check_url($_POST['slug']));
		}
		public function update() {
			if (empty($_POST['source']))
				error(__("Error"), __("URL can't be empty."));

			if (!@parse_url($_POST['source'], PHP_URL_SCHEME))
				$_POST['source'] = "http://".$_POST['source'];

			$post = new Post($_POST['id']);
			$post->update(array("name" => $_POST['name'],
			                    "source" => $_POST['source'],
			                    "description" => $_POST['description']));
		}
		public function title($post) {
			$return = $post->name;
			fallback($return, $post->title_from_excerpt());
			fallback($return, $post->source);
			return $return;
		}
		public function excerpt($post) {
			return $post->description;
		}
		public function feed_content($post) {
			return $post->description;
		}
		public function set_feed_url($url, $post) {
			if ($post->feather != "link") return;
			$url = $post->source;
		}
	}<commit_msg>Fixed Link::set_feed_url().<commit_after><?php
	class Link extends Feathers implements Feather {
		public function __construct() {
			$this->setField(array("attr" => "source",
			                      "type" => "text",
			                      "label" => __("URL", "link"),
			                      "bookmarklet" => "url"));
			$this->setField(array("attr" => "name",
			                      "type" => "text",
			                      "label" => __("Name", "link"),
			                      "bookmarklet" => "title"));
			$this->setField(array("attr" => "description",
			                      "type" => "text_block",
			                      "label" => __("Description", "link"),
			                      "optional" => true,
			                      "preview" => true,
			                      "bookmarklet" => "selection"));

			$this->setFilter("description", "markup_post_text");
			$this->respondTo("feed_url", "set_feed_url");
		}
		public function submit() {
			if (empty($_POST['source']))
				error(__("Error"), __("URL can't be empty."));

			if (!@parse_url($_POST['source'], PHP_URL_SCHEME))
				$_POST['source'] = "http://".$_POST['source'];

			fallback($_POST['slug'], sanitize($_POST['name']));

			return Post::add(array("name" => $_POST['name'],
			                        "source" => $_POST['source'],
			                        "description" => $_POST['description']),
			                 $_POST['slug'],
			                 Post::check_url($_POST['slug']));
		}
		public function update() {
			if (empty($_POST['source']))
				error(__("Error"), __("URL can't be empty."));

			if (!@parse_url($_POST['source'], PHP_URL_SCHEME))
				$_POST['source'] = "http://".$_POST['source'];

			$post = new Post($_POST['id']);
			$post->update(array("name" => $_POST['name'],
			                    "source" => $_POST['source'],
			                    "description" => $_POST['description']));
		}
		public function title($post) {
			$return = $post->name;
			fallback($return, $post->title_from_excerpt());
			fallback($return, $post->source);
			return $return;
		}
		public function excerpt($post) {
			return $post->description;
		}
		public function feed_content($post) {
			return $post->description;
		}
		public function set_feed_url($url, $post) {
			if ($post->feather != "link") return;
			return $url = $post->source;
		}
	}
{'fraction_non_alphanumeric': 0.19965760753263428, 'fraction_numerical': 0.0, 'mean_word_length': 2.245833333333333, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 69, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5358196', 'n_tokens_mistral': 1610, 'n_tokens_neox': 1328, 'n_words': 254}