Fix hash handling
This commit is contained in:
		
							parent
							
								
									6d57778dc7
								
							
						
					
					
						commit
						8a678a620f
					
				
					 1 changed files with 5 additions and 5 deletions
				
			
		
							
								
								
									
										10
									
								
								epubfs.php
									
										
									
									
									
								
							
							
						
						
									
										10
									
								
								epubfs.php
									
										
									
									
									
								
							| 
						 | 
				
			
			@ -34,18 +34,18 @@ try {
 | 
			
		|||
    $callback = function ($m) use ($book, $component, $add) {
 | 
			
		||||
        $method = $m[1];
 | 
			
		||||
        $path = $m[2];
 | 
			
		||||
        $end = "";
 | 
			
		||||
        if (preg_match ("/^src:/", $method)) {
 | 
			
		||||
            $end = ")";
 | 
			
		||||
        }
 | 
			
		||||
        if (preg_match ("/^#/", $path)) {
 | 
			
		||||
            return $path;
 | 
			
		||||
            return "{$method}'{$path}'{$end}";
 | 
			
		||||
        }
 | 
			
		||||
        $hash = "";
 | 
			
		||||
        if (preg_match ("/^(.+)#(.+)$/", $path, $matches)) {
 | 
			
		||||
            $path = $matches [1];
 | 
			
		||||
            $hash = "#" . $matches [2];
 | 
			
		||||
        }
 | 
			
		||||
        $end = "";
 | 
			
		||||
        if (preg_match ("/^src:/", $method)) {
 | 
			
		||||
            $end = ")";
 | 
			
		||||
        }
 | 
			
		||||
        $comp = $book->getComponentName ($component, $path);
 | 
			
		||||
        if (!$comp) return "#";
 | 
			
		||||
        return str_replace ("&", "&", "{$method}'epubfs.php?{$add}comp={$comp}{$hash}'{$end}");
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue