<commit_before><?php

use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\PConfig;

require_once 'include/conversation.php';
require_once 'include/group.php';
require_once 'include/contact_widgets.php';
require_once 'include/items.php';
require_once 'include/ForumManager.php';
require_once 'include/acl_selectors.php';

function network_init(App $a) {
	if (!local_user()) {
		notice(t('Permission denied.') . EOL);
		return;
	}

	$search = (x($_GET, 'search') ? escape_tags($_GET['search']) : '');

	if (($search != '') && !empty($_GET['submit'])) {
		goaway('search?search='.urlencode($search));
	}

	if (x($_GET, 'save')) {
		$exists = dba::exists('search', array('uid' => local_user(), 'term' => $search));
		if (!$exists) {
			dba::insert('search', array('uid' => local_user(), 'term' => $search));
		}
	}
	if (x($_GET, 'remove')) {
		dba::delete('search', array('uid' => local_user(), 'term' => $search));
	}

	$is_a_date_query = false;
	if (x($_GET, 'cid') && intval($_GET['cid']) != 0) {
		$cid = $_GET['cid'];
	}

	if ($a->argc > 1) {
		for ($x = 1; $x < $a->argc; $x ++) {
			if (is_a_date_arg($a->argv[$x])) {
				$is_a_date_query = true;
				break;
			}
		}
	}

	// convert query string to array. remove friendica args
	$query_array = array();
	$query_string = str_replace($a->cmd."?", "", $a->query_string);
	parse_str($query_string, $query_array);
	array_shift($query_array);
<commit_msg>Bugfix: Switch to all networks when posts for a single contact are selected.<commit_after><?php

use Friendica\App;
use Friendica\Core\System;
use Friendica\Core\Config;
use Friendica\Core\PConfig;

require_once 'include/conversation.php';
require_once 'include/group.php';
require_once 'include/contact_widgets.php';
require_once 'include/items.php';
require_once 'include/ForumManager.php';
require_once 'include/acl_selectors.php';

function network_init(App $a) {
	if (!local_user()) {
		notice(t('Permission denied.') . EOL);
		return;
	}

	$search = (x($_GET, 'search') ? escape_tags($_GET['search']) : '');

	if (($search != '') && !empty($_GET['submit'])) {
		goaway('search?search='.urlencode($search));
	}

	if (x($_GET, 'save')) {
		$exists = dba::exists('search', array('uid' => local_user(), 'term' => $search));
		if (!$exists) {
			dba::insert('search', array('uid' => local_user(), 'term' => $search));
		}
	}
	if (x($_GET, 'remove')) {
		dba::delete('search', array('uid' => local_user(), 'term' => $search));
	}

	$is_a_date_query = false;
	if (x($_GET, 'cid') && intval($_GET['cid']) != 0) {
		$cid = $_GET['cid'];
		$_GET['nets'] = 'all';

	}

	if ($a->argc > 1) {
		for ($x = 1; $x < $a->argc; $x ++) {
			if (is_a_date_arg($a->argv[$x])) {
				$is_a_date_query = true;
				break;
			}
		}
	}

	// convert query string to array. remove friendica args
	$query_array = array();
	$query_string = str_replace($a->cmd."?", "", $a->query_string);
	parse_str($query_string, $query_array);
	array_shift($query_array);

{'fraction_non_alphanumeric': 0.22166162125798855, 'fraction_numerical': 0.0020181634712411706, 'mean_word_length': 4.854330708661418, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 27, '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': '2044982', 'n_tokens_mistral': 1172, 'n_tokens_neox': 1117, 'n_words': 216}