/[Frey]/trunk/lib/Frey/Editor.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/lib/Frey/Editor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 416 by dpavlin, Tue Nov 18 12:02:57 2008 UTC revision 417 by dpavlin, Tue Nov 18 16:39:13 2008 UTC
# Line 1  Line 1 
1  package Frey::Editor;  package Frey::Editor;
2  use Moose;  use Moose;
3    
4    extends 'Frey::ClassLoader';
5    
6  =head1 DESCRIPTION  =head1 DESCRIPTION
7    
8  Support for local editor invocation from web  Support for local editor invocation from web
# Line 24  sub url_regex { qr{/editor\+?(.+?)\+(\d+ Line 26  sub url_regex { qr{/editor\+?(.+?)\+(\d+
26  sub command {  sub command {
27          my ( $self, $url ) = @_;          my ( $self, $url ) = @_;
28          $url =~ url_regex;          $url =~ url_regex;
29            my ( $path, $line ) = ( $1, $2 );
30            # FIXME SECURITY path verification for $path
31          my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';          my $editor = $ENV{VISUAL} || $ENV{EDITOR} || 'vi';
32          # FIXME SECURITY path verification for $1          $path = $self->class_path( $path ) || $path if ! -e $path;
33          my $cmd = "$editor $1 +$2";          my $cmd = "$editor $path +$line";
34          warn "# $url -> system $cmd";          warn "# $url -> system $cmd";
35          return $cmd;          return $cmd;
36  }  }

Legend:
Removed from v.416  
changed lines
  Added in v.417

  ViewVC Help
Powered by ViewVC 1.1.26