Commit d93170d3 authored by Nigel McNie's avatar Nigel McNie

Be a bit smarter about what config data we slurp from the mahara config file

parent 7b22472b
......@@ -13,7 +13,7 @@ sub new {
my $data = slurp($self->{config_file});
while ( $data =~ m{ \$cfg-> ( [^=\s]+ ) \s* = \s* ([^;]+) }gxms ) {
while ( $data =~ m{ ^ \s+ \$cfg-> ( [^=\s]+ ) \s* = \s* ([^;]+) }gxms ) {
my ($key, $value) = ($1, $2);
$value =~ s{ \A ' ( .*? ) ' \z }{$1}xms;
$self->{config}{$key} = $value;
......
......@@ -53,7 +53,7 @@ sub pretend {
sub insert_random_users {
my ($self, $count) = @_;
my $prefix = $self->{config}->get('dbprefix');
my $prefix = $self->{config}->get('dbprefix') || '';
# get a list of existing usernames
my $existing_users = $self->{dbh}->selectall_hashref('SELECT id, username FROM ' . $prefix . 'usr', 'username');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment