Bug #21625 » typo3core_bugfix_12682_trunk_v2.patch

Administrator Admin, 2009-12-01 19:59

View differences:

t3lib/class.t3lib_parsehtml_proc.php (copie de travail)
709 709
					} elseif($fileChar)	{	// file (internal)
710 710
						$href = $siteUrl.$link_param;
711 711
					} else {	// integer or alias (alias is without slashes or periods or commas, that is 'nospace,alphanum_x,lower,unique' according to tables.php!!)
712
						$link_params_parts = explode('#',$link_param);
713
						$idPart = trim($link_params_parts[0]);		// Link-data del
712
							// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/parameters triplet
713
						$pairParts = t3lib_div::trimExplode(',', $link_param, TRUE);
714
						$idPart = $pairParts[0];
715
						$link_params_parts = explode('#', $idPart);
716
						$idPart = trim($link_params_parts[0]);
717
						$sectionMark = trim($link_params_parts[1]);
714 718
						if (!strcmp($idPart,''))	{ $idPart=$this->recPid; }	// If no id or alias is given, set it to class record pid
715

  
716
// FIXME commented because useless - what is it for?
717
//						if ($link_params_parts[1] && !$sectionMark)	{
718
//							$sectionMark = '#'.trim($link_params_parts[1]);
719
//						}
720

  
721
							// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/? pair
722
						$pairParts = t3lib_div::trimExplode(',',$idPart);
723
						if (count($pairParts)>1)	{
724
							$idPart = $pairParts[0];
725
							// Type ? future support for?
726
						}
727 719
							// Checking if the id-parameter is an alias.
728 720
						if (!t3lib_div::testInt($idPart))	{
729 721
							list($idPartR) = t3lib_BEfunc::getRecordsByField('pages','alias',$idPart);
......
731 723
						}
732 724
						$page = t3lib_BEfunc::getRecord('pages', $idPart);
733 725
						if (is_array($page))	{	// Page must exist...
734
							$pairParts = t3lib_div::trimExplode(',',$link_param);
735
							$href = $siteUrl.'?id='.$pairParts[0].($pairParts[2]?$pairParts[2]:'');
726
							$href = $siteUrl .'?id=' . $idPart . ($pairParts[2] ? $pairParts[2] : '') . ($sectionMark ? '#' . $sectionMark : '');
736 727
							// linkHandler - allowing links to start with registerd linkHandler e.g.. "record:"
737 728
						} elseif (isset($GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_content.php']['typolinkLinkHandler'][array_shift(explode(':', $link_param))])) {
738 729
							$href = $link_param;
typo3/sysext/cms/tslib/class.tslib_content.php (copie de travail)
5964 5964
					}
5965 5965
	 			} else {	// integer or alias (alias is without slashes or periods or commas, that is 'nospace,alphanum_x,lower,unique' according to definition in $TCA!)
5966 5966
					if ($conf['no_cache.'])	$conf['no_cache']=$this->stdWrap($conf['no_cache'], $conf['no_cache.']);
5967
					$link_params_parts=explode('#',$link_param);
5967
						// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/parameters triplet
5968
					$pairParts = t3lib_div::trimExplode(',', $link_param, TRUE);
5969
					$link_param = $pairParts[0];
5970
					$link_params_parts = explode('#', $link_param);
5968 5971
					$link_param = trim($link_params_parts[0]);		// Link-data del
5969 5972
					if (!strcmp($link_param,''))	{$link_param=$GLOBALS['TSFE']->id;}	// If no id or alias is given
5970 5973
					if ($link_params_parts[1] && !$sectionMark)	{
5971 5974
						$sectionMark = trim($link_params_parts[1]);
5972 5975
						$sectionMark = (t3lib_div::testInt($sectionMark)?'#c':'#').$sectionMark;
5973 5976
					}
5974
						// Splitting the parameter by ',' and if the array counts more than 1 element it's a id/type/? pair
5975 5977
					unset($theTypeP);
5976
					$pairParts = t3lib_div::trimExplode(',',$link_param);
5977 5978
					if (count($pairParts)>1)	{
5978
						$link_param = $pairParts[0];
5979 5979
						$theTypeP = isset($pairParts[1]) ? $pairParts[1] : 0;		// Overruling 'type'
5980 5980
						$conf['additionalParams'].= isset($pairParts[2]) ? $pairParts[2] : '';
5981 5981
					}
typo3/sysext/rtehtmlarea/mod3/class.tx_rtehtmlarea_browse_links.php (copie de travail)
518 518
			// Link setting functions
519 519
		$JScode.='
520 520
			function link_typo3Page(id,anchor) {
521
				var parameters = document.ltargetform.query_parameters ? (document.ltargetform.query_parameters.value.charAt(0) == "&"?"":"&") + document.ltargetform.query_parameters.value : "";
522
				var theLink = \''.$this->siteURL.'?id=\'+id+(anchor?anchor:"")+parameters;
521
				var parameters = (document.ltargetform.query_parameters && document.ltargetform.query_parameters.value) ? (document.ltargetform.query_parameters.value.charAt(0) == "&" ? "" : "&") + document.ltargetform.query_parameters.value : "";
522
				var theLink = \'' . $this->siteURL . '?id=\' + id + parameters + (anchor ? anchor : "");
523 523
				if (document.ltargetform.anchor_title) browse_links_setTitle(document.ltargetform.anchor_title.value);
524 524
				if (document.ltargetform.anchor_class) browse_links_setClass(document.ltargetform.anchor_class.value);
525 525
				if (document.ltargetform.ltarget) browse_links_setTarget(document.ltargetform.ltarget.value);
......
542 542
				return false;
543 543
			}
544 544
			function link_current()	{
545
				var parameters = document.ltargetform.query_parameters ? (document.ltargetform.query_parameters.value.charAt(0) == "&"?"":"&") + document.ltargetform.query_parameters.value : "";
545
				var parameters = (document.ltargetform.query_parameters && document.ltargetform.query_parameters.value) ? (document.ltargetform.query_parameters.value.charAt(0) == "&" ? "" : "&") + document.ltargetform.query_parameters.value : "";
546 546
				if (document.ltargetform.anchor_title) browse_links_setTitle(document.ltargetform.anchor_title.value);
547 547
				if (document.ltargetform.anchor_class) browse_links_setClass(document.ltargetform.anchor_class.value);
548 548
				if (document.ltargetform.ltarget) browse_links_setTarget(document.ltargetform.ltarget.value);
(1-1/2)