Changeset 1880

Show
Ignore:
Timestamp:
07/24/2012 10:24:38 PM (10 months ago)
Author:
BrianKoontz
Message:

Permit the specification of forceLinkTracking in action calls that
will preserve linktracking such as with {{image}} links that point to
internal wiki pages. By default, forceLinkTracking remains disabled
for all action calls. Refs #1126.

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/actions/image/image.php

    r1848 r1880  
    2626 * @input int $width optional: width used to strech or shrink the image along its width 
    2727 * @input int $height optional: height used to strech or shrink the image along its height 
     28 * @input boolean $forceLinkTracking optional: use to create backlinks for images linking to other wiki pages default: FALSE  
    2829 * 
    2930 * @output string img element or image link 
  • trunk/libs/Wakka.class.php

    r1865 r1880  
    34913491                                        //                      to validate its own parameters! 
    34923492                                        //                      That includes guarding against directory traversal. 
    3493                                         $vars[$matches[1][$a]] = $this->htmlspecialchars_ent($matches[3][$a]);  // parameter name = sanitized value [SEC] 
     3493                                        // Check to see if linktracking is desired (for 
     3494                                        // instance, when using {{image}} tags to link to 
     3495                                        // other wiki pages 
     3496                                        if(FALSE !== strpos($matches[1][$a], "forceLinkTracking"))  
     3497                                        { 
     3498                                                if(TRUE == $this->htmlspecialchars_ent($matches[3][$a])) 
     3499                                                { 
     3500                                                        $forceLinkTracking = 1;  
     3501                                                } 
     3502                                                else 
     3503                                                { 
     3504                                                        $forceLinkTracking = 0; 
     3505                                                } 
     3506                                        } 
     3507                                        else  
     3508                                        { 
     3509                                                $vars[$matches[1][$a]] = $this->htmlspecialchars_ent($matches[3][$a]);  // parameter name = sanitized value [SEC] 
     3510                                        } 
    34943511                                } 
    34953512                        }