summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 58a2dec)
raw | patch | inline | side by side (parent: 58a2dec)
author | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Oct 2010 07:20:27 +0000 (07:20 +0000) | ||
committer | hickert <hickert@594d385d-05f5-0310-b6e9-bd551577e9d8> | |
Tue, 5 Oct 2010 07:20:27 +0000 (07:20 +0000) |
git-svn-id: https://oss.gonicus.de/repositories/gosa/trunk@19915 594d385d-05f5-0310-b6e9-bd551577e9d8
gosa-core/include/functions.inc | patch | blob | history |
index 338ab70da6afc6a643082332abee24394e37a9aa..629fcd3ca688dc285e78297a94539fb9e720ffce 100644 (file)
/*! \brief Replaces placeholder in a given string.
* For example:
* '%uid@gonicus.de' Replaces '%uid' with 'uid'.
- * '%uid{0}@gonicus.de' Replaces '%uid{0}' with the first char of 'uid'.
- * '%uid{2:4}@gonicus.de' Replaces '%uid{2:4}' with three chars from 'uid' starting from the second.
+ * '{%uid[0]@gonicus.de}' Replaces '%uid[0]' with the first char of 'uid'.
+ * '%uid[2-4]@gonicus.de' Replaces '%uid[2-4]' with three chars from 'uid' starting from the second.
+ *
+ * The surrounding {} in example 2 are optional.
*
* @param String The string to perform the action on.
* @param Array An array of replacements.
*/
function fillReplacements($str, $attrs, $shellArg = FALSE, $default = "")
{
- // Search for '%...{...}
+ // Search for '{%...[n-m]}
// Get all matching parts of the given string and sort them by
// length, to avoid replacing strings like '%uidNumber' with 'uid'
// instead of 'uidNumber'; The longest tring at first.