Skip to content

Commit

Permalink
- Fixed bug #6908: Object name pattern problems.
Browse files Browse the repository at this point in the history
  (Merged from stable/3.7 (3.7.0rc1) rev. 12578 ).



git-svn-id: file:///home/patrick.allaert/svn-git/ezp-repo/ezpublish/stable/3.5@12580 a01eee8c-daba-0310-acae-fa49f3023285
  • Loading branch information
Sergiy Pushchin committed Jul 18, 2005
1 parent 9764dea commit 2df96cf
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
4 changes: 3 additions & 1 deletion doc/changelogs/3.5/unstable/CHANGELOG-3.5.4rc1-to-3.5.4
Expand Up @@ -13,8 +13,10 @@ Changes from 3.5.4rc1 to 3.5.4
- Fixed bug #6884: Wrong customer name in order details.
- Fixed bug #6757: eZMail does not set the required Date header.
- Fixed bug #5766: Typo in shop/module.php.
- Fixed bug #6814: The drafts of top level nodes can't be removed
- Fixed bug #6814: The drafts of top level nodes can't be removed.
- Fixed bug #6864: Fixed module_params() operator to work in templates
other than pageleyout.
- Fixed bug #6908: Object name pattern problems.
(Merged from stable/3.7 (3.7.0rc1) rev. 12578 ).

*Translations:
36 changes: 34 additions & 2 deletions kernel/classes/ezcontentclass.php
Expand Up @@ -1164,12 +1164,38 @@ function contentObjectName( &$contentObject, $version = false, $translation = fa

eZDebugSetting::writeDebug( 'kernel-content-class', $dataMap, "data map" );

// get all tags to replace
preg_match_all( "|\([^\)]+\)|U",
$contentObjectName,
$subTagMatchArray );
$i = 0;
$tmpTagResultArray = array();
foreach ( $subTagMatchArray[0] as $subTag )
{
$tmpTag = 'tmptag' . $i;

$contentObjectName = str_replace( $subTag, $tmpTag, $contentObjectName );

$subTag = str_replace( "(", "", $subTag );
$subTag = str_replace( ")", "", $subTag );

$tmpTagResultArray[$tmpTag] = eZContentClass::buildContentObjectName( $subTag, $dataMap );
$i++;
}
$contentObjectName = eZContentClass::buildContentObjectName( $contentObjectName, $dataMap, $tmpTagResultArray );
return $contentObjectName;
}

/*!
Generates a name for the content object based on the content object name pattern
and data map of an object.
*/
function buildContentObjectName( &$contentObjectName, $dataMap, $tmpTags = false )
{

preg_match_all( "|<[^>]+>|U",
$contentObjectName,
$tagMatchArray );

eZDebugSetting::writeDebug( 'kernel-content-class', $tagMatchArray );
foreach ( $tagMatchArray[0] as $tag )
{
$tagName = str_replace( "<", "", $tag );
Expand All @@ -1187,6 +1213,12 @@ function contentObjectName( &$contentObject, $version = false, $translation = fa
if ( $namePart != "" )
break;
}
elseif ( $tmpTags && isset( $tmpTags[$name] ) && $tmpTags[$name] != '' )
{
$namePart = $tmpTags[$name];
break;
}

}

// replace tag with object name part
Expand Down

0 comments on commit 2df96cf

Please sign in to comment.